Edit: added keys.
Hi,
I have a xml schema with the following types:
<xs:complexType name="definition">
<xs:sequence/>
<xs:attribute name="id"/>
</xs:complexType>
<xsd:key name="definitionId">
<xsd:selector xpath="definition"/>
<xsd:field xpath="@id"/>
</xsd:key>
<xs:complexType name="elem">
<xs:sequence>
<xs:element name="entry1" type="elem" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="entry2" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="ref" type="xs:string" use="required"/>
</xs:complexType>
This allows something like:
<definition id="A">
<definition id="B">
<definition id="C">
<entry1 ref="A">
<entry1 ref="B">
<entry1 ref="C"/>
<entry2/>
</entry1>
<entry1 ref="C">
</entry1>
</entry1>
I need a a XPath-selector to declare a keyref to the ref
attribute but i don't have a clue how to define a recursive path.
<xsd:keyref name="definitionRef" refer="definitionId">
<xsd:selector xpath="???"/> <<<how to find all "ref" of entry1 ?
<xsd:field xpath="@ref"/>
</xsd:keyref>
Thanks for your time.