keyRef scope and Xerces Parser !?

Imagine you have the following XML-Document

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

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

...

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

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

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

...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,

Uwe

 

Received on Tuesday, 26 June 2001 15:38:05 UTC