Edit: added keys.
Hi,
I have an 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 an XPath selector to declare keyref for the ref attribute, but I have no hint on 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>
Thank you for your time.
source share