XML technologies / XSLT / Introduction to XSLT 2.0 / Getting started with XSLT and XPath / Axes and node tests / A node test for selection
(Excerpt from "XSLT 2.0 & XPath 2.0" by Frank Bongers, Chapter 1.)
Writing the node test on the previous page with a function’s parentheses indicates that it essentially describes active filtering
From all nodes on the chosen axis of the location step, the node test selects the subset satisfying the test. These nodes form the result set of that individual step.
In the most straightforward case, the node test consists of the name of the desired nodes. This is possible only for named nodes, such as elements or attributes. The node test is then called a NameTest. For the remaining node kinds there are dedicated tests. Although these look like functions, they are not classified as such: text() selects text nodes, for example, while comment() selects comment nodes. Since these tests concern the node’s kind (kind) they are also called KindTest. There is even a neutral KindTest that matches all nodes, whether named or unnamed: node().
Because each step specifies an axis, a compound path expression could change direction several times. This is rather uncommon, but the involvement of up to three axes is conceivable. After the final step, a result sequence remains: the nodes satisfying the conditions of all steps in their specified order.
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