我想问一下是否有人知道如何使用 XPath 查询进行 XSD 1.1 条件类型分配检查元素是否没有属性,例如:
<!--inline alternative type definitions -->
<element name="TimeTravel" type="TravelType">
<alternative test="@direction='Future'">
<complexType>
<complexContent>
<restriction base="TravelType"
....
<!-- some past travel related elements go here -->
</complexType>
</alternative>
<alternative test="@direction='Past'">
<complexType>
<complexContent>
<restriction base="TravelType"
....
<!-- some future travel related elements go here -->
</complexType>
</alternative>
</element>
OR
<!--Named alternative type definitions -->
<element name="TimeTravel" type="TravelType">
<alternative test="@direction='Future' type="FutureTravelType"/>
<alternative test="@direction='Past' type="PastTravelType"/>
</element>
在本例中,'alternative test=""' 检查 TimeTravel 元素的属性“direction”是否具有“Future”或“Past”的值。我应该如何编写 XPath 查询来检查当前元素是否没有“direction”属性?