Re: keyRef scope and Xerces Parser !?

> Uwe Zeise wrote:
> 
.../...
> 
> <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 ?

It means that a xs:unique or xs:key and its corresponding xs:keyref need
to be defined in the same element (the tables storing the values are
local to this element).

In your example, you have no other choice than defining both at the
level of the root element.

Hope this helps.

Eric

> Thanks in advance and best regards,
> 
> Uwe
> 
> 

-- 
Pour y voir plus clair dans la nebuleuse XML...
                                          http://dyomedea.com/formation/
------------------------------------------------------------------------
Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
http://xsltunit.org      http://4xt.org           http://examplotron.org
------------------------------------------------------------------------

Received on Tuesday, 26 June 2001 17:00:37 UTC