The axis of a node test determines what general category of nodes may be considered for the following node test. There are thirteen axes:
-
ancestor : Ancestors of the current node
ancestor-or-self : Ancestors, including the current node
-
attribute : Attributes of the current node (abbreviated "@")
-
child : Children of the current node (the default axis)
-
descendant : Descendants of the current node
-
descendant-or-self : Descendants, including the current node (abbreviated "//")
-
following / following-sibling : Elements which occur after the current node, in document order
-
preceding / preceding-sibling : Elements which occur before the current node, in document order (returned in reverse-document order)
-
namespace : The namespace nodes of the current node
-
parent : The parent of the current node (abbreviated "..")
-
self : The current node (abbreviated ".")
This graphic of Crane Softwrights demonstrates the axes graphically.