XML technologies / XSLT / Introduction to XSLT 2.0 / Getting started with XSLT and XPath / Axes and node tests / A short tour of the axes
(Excerpt from "XSLT 2.0 & XPath 2.0" by Frank Bongers, Chapter 1.)
A document tree offers many possible directions, some frequently used and others rarely. The most important for us is the Child axis, describing the step from the context node to its children. The reverse direction is the Parent axis, whereas the Self axis means remaining on the context node.
A greater forward reach is provided by the Descendant axis and the Descendant-Or-Self axis, potentially covering every node in branches starting at the context node and, in the second case, the context node itself.
Less frequently used directions also have their own axes: looking backward, the analogous axes are the Ancestor axis and the Ancestor-Or-Self axis.
Four further axes look sideways; they need not be discussed here: Preceding-Sibling axis and Following-Sibling axis as well as Preceding axis and Following axis. Since the axes listed so far mainly find elements, they are collectively called element axes. Together they cover the document tree.
Two more axes are absent from the tree diagram: the attribute axis is nevertheless important, whereas the namespace axis exists mainly as a formality in XPath 2.0.
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