I would like to ask if someone knows how to make an XSD 1.1 Conditional Type Assignment check if an element hasn't an attribute using the XPath query, e.g.:
<!--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>
In this example the 'alternative test=""' checks whether the attribute "direction" of the TimeTravel element has a value of "Future" or "Past". How should I write the XPath query to check if e.g. there's no "direction" attribute for the current element?