Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.12.0
-
None
Description
XML Schema 1.1 has introduced the attribute 'ref' on xs:key, xs:unique and xs:keyref. While processing the following schema in XSD 1.0 mode with Xerces's XSD 1.1 processor, a java.lang.NullPointerException is emitted when the schema document is processed with Xerces sample jaxp.SourceValidator.
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="X">
<xs:complexType>
<xs:sequence>
<xs:element name="a" type="xs:integer" maxOccurs="unbounded"/>
<xs:element name="b" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
<xs:key name="a_key">
<xs:selector xpath="a"/>
<xs:field xpath="."/>
</xs:key>
</xs:element>
<xs:element name="Y">
<xs:complexType>
<xs:sequence>
<xs:element name="a" type="xs:integer" maxOccurs="unbounded"/>
<xs:element name="b" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
<xs:key ref="a_key"/>
</xs:element>
</xs:schema>