XML technologies / XSLT / Introduction to XSLT 2.0 / Getting started with XSLT and XPath / Axes and node tests / An axis for the direction of movement

(Excerpt from "XSLT 2.0 & XPath 2.0" by Frank Bongers, Chapter 1.)

For precisely this reason, specifying the desired direction of movement is part of every location step. XPath calls this directional specification an axis. (Note: The thirteen XPath axes are only mentioned here, not discussed exhaustively. For more detail, see the XPath 2.0 language reference under Path expressions: Axes.

An axis is more than a direction: it also has a reach defining the nodes it can access.

XPath distinguishes thirteen axes with different directions and reaches. Direction defines movement through the tree from the context node. Reach determines the number of potentially selectable nodes.

Our earlier simplified view of a location step needs revision: it always consists of two parts, the axis specifier and the node test (node test). Splitting the Location Step accordingly produces the following picture:

achsenbezeichner::knotentest()

Next we examine its second half, the node test, which describes what to select at the destination of the specified direction.

   

back to top