The line/col numbers are always for the start tag of <complexType> element
for UPA errors (and other constraints governed by schema-full-checking).
You might be expecting the line/col numbers for the particle that violates
UPA, but this is difficult to implement, and sometimes not that useful.
Difficult: these constraints can only be checked after we gather all the
information about the complex type and construct a content model, and it's
too expansive to carry the line/col information for each particle involved.
Not useful: in your example, should we report error against
1. the global element A, or
2. the reference to the global A, or
3. the reference to group "seqABgroup"?
If the group "seqABgroup" is referenced many time in the schema, the 1 and
2 won't be much useful. But 3 is not too much different from the location
of the <complexType> tag.
The bottom line is that, by reporting the location of the complex type, the
author should be able to figure out how the type violates the constraint,
since he/she is familiar with how the type is constructed.
Hope this helps,
Sandy Gao
Software Developer, IBM Canada
(1-905) 413-3255
[EMAIL PROTECTED]
John Utz
<[EMAIL PROTECTED] To: [EMAIL PROTECTED]
sh.com> cc: [email protected]
Subject: Re: [Xerces-2]
Line/column numbers are available for
02/18/2002 schema errors!!!
08:19 PM
Please respond
to
xerces-j-user
hi sandy!
i am so pleasantly surprised!
On Mon, 18 Feb 2002 [EMAIL PROTECTED] wrote:
> Hi folks,
>
> We've all seen so many complains like "Why the location information is
for
> the instance document, when the error occurs in the schema document?" and
> "Why dom.ASBuilder always gives -1;-1 as the error location?" Now we can
> put an end it: proper line/column numbers are available for schema
errors!
>
> So please try it out, and let us know any further problem you encounter.
> (CVS extraction is already updated; jar files will be available tomorrow
at
> http://gump.covalent.net/jars/latest/xml-xerces2/.)
ok, here's an error and a schema, i am curious as to why it picked the
line/col that it did ( and yes, i am still fiddling with UPA errors :-) :
bash-2.04$ java dom.ASBuilder -f -a Alt4.xsd
[Error] Alt4.xsd:8:22: cos-nonambig: ("":A) and ("":A){0-1} (or elements
from their substitution group) violate "Unique Particle Attribution".
<?xml version = "1.0" encoding = "UTF-8"?>
<xsd:schema xmlns:xsd = "http://www.w3.org/2001/XMLSchema">
<xsd:element name='A' type='xsd:anyType'/>
<xsd:element name='B' type='xsd:anyType'/>
<xsd:element name='seqAB'>
<xsd:complexType>
<xsd:sequence>
<xsd:group ref='seqABgroup' minOccurs='0' maxOccurs='unbounded'/>
<xsd:element ref='A' minOccurs='0'/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:group name='seqABgroup'>
<xsd:sequence>
<xsd:element ref='A'/>
<xsd:element ref='B'/>
</xsd:sequence>
</xsd:group>
</xsd:schema>
> Cheers,
> Sandy Gao
> Software Developer, IBM Canada
> (1-905) 413-3255
> [EMAIL PROTECTED]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]