W3C home > Mailing lists > Public > xmlschema-dev@w3.org > June 2001

keyRef scope and Xerces Parser !?

From: Uwe Zeise <uwezeise@yahoo.de>
Date: Tue, 26 Jun 2001 21:37:57 +0200
Message-ID: <000f01c0fe77$81b10800$1a9fe3d9@compaq>
To: <xmlschema-dev@w3.org>
Imagine you have the following XML-Document

  <probability probID="prob1">0.20</probability>
  <probability probID="prob2">0.30</probability>
  <probability probID="prob3">0.50</probability>
  <value probRef="prob1">130.00</value>
  <value probRef="prob2">150.00</value>
  <value probRef="prob3">200.00</value>

My XML-Schema looks (just the important parts) like this:


<element name="root">
   <element ref="a:probabilites"/>
   <element ref="a:values"/>

<element name="probabilities">
   <element ref="a:probability" maxOccurs="10"/>
 <key name="probKey">
  <selector xpath="./a:probability"/>
  <field xpath="@probID"/>

<element name="values">
   <element ref="a:value" maxOccurs="10"/>
 <keyref name="probRef" refer="a:probKey">
  <selector xpath="./a:value"/>
  <field xpath="@probRef"/>

...and so on

In my opinion this XML-Schema fulfills the specs but the Xerces-Parser is complaining about the reference:

Error:  org.xml.sax.SAXParseException: Identity Constraint error:  identity cons
traint "KeyRef@19f91c" has a keyref which refers to a key or unique that is out
of scope.

What does this error exactly mean ?

Thanks in advance and best regards,



Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
Received on Tuesday, 26 June 2001 15:38:05 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:52 UTC