  | |  | Created: (XERCESJ-1252) error msg on unqualified global attribute confusi | Created: (XERCESJ-1252) error msg on unqualified global attribute confusi 2007-05-21 - By Paul V. Biron (JIRA)
error msg on unqualified global attribute confusing ---------------------------------------------------
Key: XERCESJ-1252 URL: https://issues.apache.org/jira/browse/XERCESJ-1252 Project: Xerces2-J Issue Type: Improvement Components: XML Schema Structures Affects Versions: 2.9.0 Environment: XP Home/SP2; jre 1.5.0_11 Reporter: Paul V. Biron Priority: Minor
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 (@(protected) 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).
-- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
--------------------------------------------------------------------- To unsubscribe, e-mail: j-dev-unsubscribe@(protected) For additional commands, e-mail: j-dev-help@(protected)
|
|
 |