XML technologies / XPath / XPath 2.0: language reference / Path expressions: axes / Descendant axis
(Excerpt from "XSLT 2.0 & XPath 2.0" by Frank Bongers, chapter 4.)
Defined for: XPath 1.0 and 2.0, XQuery 1.0
Direction: forward
Axis identifier: descendant
Abbreviated syntax: none
Figure: the descendant axis.
The descendant axis contains all nodes directly or indirectly descended from the context node: its children and their children. It therefore contains the context node’s content, explaining why attribute and namespace nodes are excluded.
Every branch descended from the context node is tested to its end, whose final node is also called a leaf node. If the current node is not an element node, the descendant axis is empty.
Example:
descendant::*
selects all element nodes descended from the context node: its children and further descendants.
descendant::text()
selects all text nodes descended from the current node. Because the result sequence is in document order, its content corresponds to the context node’s string value, although the text nodes form a sequence rather than a concatenated string.
Copyright © Galileo Press, Bonn 2008
You may print the online version for private use.
Otherwise, this chapter from "XSLT 2.0 & XPath 2.0 ― Das umfassende Handbuch" is subject to the same terms as the bound edition: the work and all its parts are protected by copyright. All rights reserved, including reproduction, translation, microfilming, storage and processing in electronic systems.
Galileo Press, Rheinwerkallee 4, 53227 Bonn