Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The axis specifies the tree relationship between the nodes selected by the location step and the context node. The following axes are supported:
childContains the child of the context node.
The following XPath expression (location path) selects from the current context node all the <Customer> children:
child::CustomerIn the following XPath query,
childis the axis.Customeris the node test.parentContains the parent of the context node.
The following XPath expression selects all the <Customer> parents of the <Order> children:
child::Customer/child::Order[parent::Customer/@customerID="ALFKI"]This is the same as specifying
child::Customer. In this XPath query,childandparentare the axes.CustomerandOrderare the node tests.attributeContains the attribute of the context node.
The following XPath expression selects the CustomerID attribute of the context node:
attribute::CustomerIDselfContains the context node itself.
The following XPath expression selects the current node if it is the <Order> node:
self::OrderIn this XPath query,
selfis the axis andOrderis the node test.