In Brief
-
Each location step is made up of an axis, a node test, and zero or more predicates.
-
An axis indicates how to search for nodes. Here are the XPath 1.0 axes:
-
The child axis
-
The attribute axis
-
The ancestor axis
-
The ancestor-or-self axis
-
The descendant axis
-
The descendant-or-self axis
-
The following axis
-
The following-sibling axis
-
The namespace axis
-
The parent axis
-
The preceding axis
-
The preceding-sibling axis
-
The self axis
-
You can use these node tests in XPath 1.0:
-
The * wildcard character matches any element or attribute name.
-
-A name matches a node with that name (for example, planet will match a <planet> element).
-
The comment() node test selects comment nodes.
-
The node() node test selects any type of node.
-
The processing-instruction() node test selects a processing instruction node.
-
The text() node test selects a text node.
-
Predicates are enclosed in [ and ] and may contain any valid XPath 1.0 expression.