[
https://issues.apache.org/jira/browse/XERCESJ-1486?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
David Costanzo updated XERCESJ-1486:
------------------------------------
Fix Version/s: 2.12.0
For the purpose of release tracking...the fix was made to trunk in subversion
revision 1040377 and to the xml-schema-1.1-dev branch in subversion revision
1040371.
> XML Schema: improved error reporting with namespace qualified elements
> ----------------------------------------------------------------------
>
> Key: XERCESJ-1486
> URL: https://issues.apache.org/jira/browse/XERCESJ-1486
> Project: Xerces2-J
> Issue Type: Improvement
> Affects Versions: 2.11.0
> Reporter: Mukul Gandhi
> Assignee: Mukul Gandhi
> Priority: Minor
> Fix For: 2.12.0
>
>
> Please consider following example.
> temp.xml
> <X xmlns="http://xyz">
> <a>hello world</a>
> <b>hello world ..</b>
> <c/>
> </X>
> temp.xsd
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
> targetNamespace="http://xyz" xmlns:ns1="http://xyz1"
> elementFormDefault="qualified">
> <xs:import namespace="http://xyz1" schemaLocation="temp1.xsd" />
>
> <xs:element name="X">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="a" type="xs:string" />
> <xs:element name="b" type="xs:string" form="unqualified"/>
> <xs:element ref="ns1:c" />
> </xs:sequence>
> </xs:complexType>
> </xs:element>
>
> </xs:schema>
> temp1.xsd
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
> targetNamespace="http://xyz1" elementFormDefault="qualified">
> <xs:element name="c" type="xs:string" />
>
> </xs:schema>
> When the XML document temp.xml is validated by the schema document temp.xsd,
> Xerces currently reports an error message as following:
> [Error] temp.xml:3:6: cvc-complex-type.2.4.a: Invalid content was found
> starting with element 'b'. One of '{b}' is expected.
> Since the element "b" is in a namespace I thought an error message like
> following would probably be more appropriate (i.e qualify element
> descriptions with namespace URIs for non null namespace URIs):
> [Error] temp.xml:3:6: cvc-complex-type.2.4.a: Invalid content was found
> starting with element '{"http://xyz":b}'. One of '{b}' is expected.
> I've written a patch that makes this improvement and would be committing it
> asap.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]