Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Duplicate
-
2.9.0
-
None
-
None
-
XP Home/SP2; jre 1.5.0_11
Description
Given this simple schema document:
<xs:schema
xmlns:xs='http://www.w3.org/2001/XMLSchema'
xmlns='urn:test'
targetNamespace='urn:test'
elementFormDefault='qualified'
attributeFormDefault='unqualified'>
<xs:element name='root' type='Root'/>
<xs:complexType name='Root'>
<xs:attribute ref='glob' use='required'/>
</xs:complexType>
<xs:attribute name='glob' type='xs:string'/>
</xs:schema>
and this simple instance:
<my:root xmlns:my='urn:test' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xsi:schemaLocation='urn:test globAttr.xsd' glob='foo'/>
xerces (correctly) reports the following 2 error msgs:
[Error] globAttr.xml:2:58: cvc-complex-type.3.2.2: Attribute 'glob' is not allowed to appear in element 'my:root'.
[Error] globAttr.xml:2:58: cvc-complex-type.4: Attribute 'glob' must appear on element 'my:root'.
While this is correct (@glob should be qualified) you can imagine who those msgs would confuse a novice. It's not worth spending a lot of time improving the error messages, but if you can do it quickly it would probably help the uninitiated (suggestion: just prefix 'glob' in the 2nd message...but that might make it harder to understand in other circumstances).