A node test specifies the node type selected by the location step. Every axis (child, parent, attribute, and self) has a principal node type. For the attribute axis, the principal node type is <attribute>. For the parent, child, and self axes, the principal node type is <element>.
Note The wildcard node test * (for example, child::*) is not supported.
The location path child::Customer selects <Customer> element children of the context node.
In the example, child is the axis and Customer is the node test. The principal node type for the child axis is <element>. Therefore, the node test is TRUE if the <Customer> node is an <element> node. If the context node has no <Customer> children, an empty set of nodes is returned.
The location path attribute::CustomerID selects CustomerID attribute of the context node.
In the example, attribute is the axis and CustomerID is the node test. The principal node type of the attribute axis is <attribute>. Therefore, the node test is TRUE if CustomerID is an <attribute> node. If the context node has no CustomerID, an empty set of nodes is returned.
Note In this implementation of XPath, if a location step refers to an <element> or an <attribute> type that is not declared in the schema, an error is generated. This is different from the implementation of XPath in MSXML, which returns an empty node set.
The following abbreviated syntax for the location path is supported:
The location path Customer[@CustomerID="ALFKI"] is the same as child::Customer[attribute::CustomerID="ALFKI"].
Thus, child is the default axis. The location path Customer/Order is the same as child::Customer/child::Order.