[ http://issues.apache.org/jira/browse/XERCESJ-1040?page=history ]
Michael Glavassevich resolved XERCESJ-1040:
-------------------------------------------
Resolution: Duplicate
The identity constraint bug XERCESJ-1000 was fixed in CVS. If you'd like to try
out the fix, the latest Xerces builds are located here:
http://brutus.apache.org/gump/public-jars/xml-xerces2/. The error message you
should see is: Key 'test_keyref' with value '1,4' not found for identity
constraint of element 'test'.
If you're seeing other problems it is because the local element declarations in
your schema are unqualified. See the definition for {target namespace} for
Element Declaration components in the spec:
http://www.w3.org/TR/xmlschema-1/#cElement_Declarations.
> Identity-constraint validation with multiple fields is incorrect when
> namespaces are used
> -----------------------------------------------------------------------------------------
>
> Key: XERCESJ-1040
> URL: http://issues.apache.org/jira/browse/XERCESJ-1040
> Project: Xerces2-J
> Type: Bug
> Versions: 2.6.0, 2.6.1, 2.6.2
> Reporter: Jakub Mendys
> Assignee: Michael Glavassevich
> Priority: Critical
>
> 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>
> ----------------------------------------------------
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]