I am now struggling a bit to generate automatically the XPaths leading to a certain type of my XSD schema.
In this example, I would like to get the XPath leading to "firstName" and "lastName", which means:
root/Friend/firstName, root/Friend/lastName, root/TenthGrader/firstName, root/tenthGrader/lastName, root/complicatedPerson/oldSelf/firstName, root/complicatedPerson/oldSelf/lastName
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="root">
<xs:complexType>
<xs:sequence>
<xs:element name="Friend" type="Student"/>
<xs:element name="TenthGrader">
<xs:complexType>
<xs:complexContent>
<xs:extension base="Student">
<xs:element name="Sexyteacher"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
<xs:element ref="complicatedPerson"/>
<xs:element name="IdoNothing"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="complicatedPerson" type="Person"/>
<xs:complexType name="Person">
<xs:sequence>
<xs:element name="oldSelf" type="Student"/>
<xs:element name="Age" type="xs:int"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="Student">
<xs:sequence>
<xs:element name="firstName"/>
<xs:element name="lastName"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
This is already giving me a headache.
Is there any known method to do this?
Thank you very much in advance!