Details
-
Bug
-
Status: Resolved
-
Critical
-
Resolution: Duplicate
-
2.6.0, 2.6.1, 2.6.2
-
None
-
None
-
None
Description
The line "<ref x="1" y="4"/>" in the sample XML file should produce an error.
With Xerces 2.5.0 the following error is reported:
Key 'test_keyref' with value 'ID Value: 1,ID Value: 4' not found for identity constraint of element 'test'
2.6.0 works like 2.6.2, so the difference is introduced between 2.5.0 and 2.6.0
------------------------------------------- test.xml
<?xml version="1.0" encoding="windows-1252"?>
<test
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:test.xsd"
>
<value a="1" b="3"/>
<value a="2" b="4"/>
<ref x="1" y="3"/>
<ref x="2" y="4"/>
<ref x="1" y="4"/>
</test>
----------------------------------------------------
------------------------------------------- test.xsd
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="test" type="T_test">
<xs:key name="test_key">
<xs:selector xpath="value"/>
<xs:field xpath="@a"/>
<xs:field xpath="@b"/>
</xs:key>
<xs:keyref name="test_keyref" refer="test_key">
<xs:selector xpath="ref"/>
<xs:field xpath="@x"/>
<xs:field xpath="@y"/>
</xs:keyref>
</xs:element>
<xs:complexType name="T_test">
<xs:sequence>
<xs:element name="value" maxOccurs="unbounded">
<xs:complexType>
<xs:complexContent>
<xs:restriction base="xs:anyType">
<xs:attribute name="a" type="xs:string" use="required"/>
<xs:attribute name="b" type="xs:string" use="required"/>
</xs:restriction>
</xs:complexContent>
</xs:complexType>
</xs:element>
<xs:element name="ref" maxOccurs="unbounded">
<xs:complexType>
<xs:complexContent>
<xs:restriction base="xs:anyType">
<xs:attribute name="x" type="xs:string" use="required"/>
<xs:attribute name="y" type="xs:string" use="required"/>
</xs:restriction>
</xs:complexContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:schema>
----------------------------------------------------
Attachments
Issue Links
- is a clone of
-
XERCESJ-1000 Identity-constraint validation with multiple fields is incorrect.
- Resolved