Algorithm 如何为某些元素名从XSD派生可能的XPath表达式?
我现在正在努力自动生成XPath,从而生成某种类型的XSD模式 在本例中,我希望得到指向“firstName”和“lastName”的XPath,这意味着: root/Friend/firstName、root/Friend/lastName、root/TenthGrader/firstName、root/TenthGrader/lastName、root/complementdperson/oldSelf/firstName、root/complementdperson/oldSelf/lastNameAlgorithm 如何为某些元素名从XSD派生可能的XPath表达式?,algorithm,xslt,xpath,xsd,Algorithm,Xslt,Xpath,Xsd,我现在正在努力自动生成XPath,从而生成某种类型的XSD模式 在本例中,我希望得到指向“firstName”和“lastName”的XPath,这意味着: root/Friend/firstName、root/Friend/lastName、root/TenthGrader/firstName、root/TenthGrader/lastName、root/complementdperson/oldSelf/firstName、root/complementdperson/oldSelf/las
<?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>
这已经让我头疼了
有没有已知的方法可以做到这一点
提前非常感谢 您需要创建逻辑以满足需要。你可能会从中得到一些想法,你的意思是我需要使用/创建一个函数吗?