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.
Copyright © Galileo Press, Bonn 2008
You may print the online version for your private use.
Otherwise, this chapter from "XSLT 2.0 & XPath 2.0 ― Das umfassende Handbuch" is subject to the same terms as the printed edition: the work and all its parts are protected by copyright. All rights are reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
Galileo Press, Rheinwerkallee 4, 53227 Bonn