Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Scope of keyref identity constraints (Xerces-J bug)

From: Kasimier Buchcik <K.Buchcik@---------.-->
To: ML-xml-schema-dev <xmlschema-dev@--.--->
Date: 10/11/2005 4:41:00 PM
Hi,

Xerces-J 2.7.1 reports for the following (brain-hurting) scenario:

keyref-2.xml:7,15: (Error) Identity Constraint error:  identity
constraint "KeyRef@1995d80" has a keyref which refers to a key or
unique that is out of scope.

... while XSV 2.10, IBM's SQC, Saxon 8.5.1, MSXML 4.0 SP2 and
Libxml2 2.6.22 report it as valid.

keyref-2.xsd
------------
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

  <xs:element name="SECTION-A" type="Section">
	<xs:key name="DefKey">
      <xs:selector xpath="DEFINITION"/>
      <xs:field xpath="."/>
    </xs:key>
  </xs:element>

  <xs:element name="SECTION-B" type="Section">  
    <xs:keyref name="DefRef" refer="DefKey">
      <xs:selector xpath="DEFREF"/>
      <xs:field xpath="."/>
    </xs:keyref>
  </xs:element>

  <xs:complexType name="Section">
    <xs:sequence>
	  <xs:element ref="SECTION-A" minOccurs="0"/>
	  <xs:element ref="SECTION-B" minOccurs="0"/>
	  <xs:element name="DEFINITION" type="xs:string" minOccurs="0"
maxOccurs="2"/>
	  <xs:element name="DEFREF" type="xs:string" minOccurs="0"
maxOccurs="5"/>
	</xs:sequence>
  </xs:complexType>

</xs:schema>

keyref-2.xml
------------

<SECTION-A xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:noNamespaceSchemaLocation="keyref-2.xsd">

  <SECTION-B>      
	  <DEFINITION>zappa</DEFINITION>
  </SECTION-B>
  <DEFREF>zappa</DEFREF>	

</SECTION-A>

Regards,

Kasimier

From paraveen@s... Wed Oct 12 06:14:18 2005
Received: from wiggum.w3.org ([128.30.52.23])
	by f


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent