XML technologies / XPath / XPath 2.0: language reference / Path expressions: axes / Following-sibling axis

(Excerpt from "XSLT 2.0 & XPath 2.0" by Frank Bongers, chapter 4.)

Defined for: XPath 1.0 and 2.0 (not in XQuery 1.0)

Direction: forward

Axis identifier: following-sibling

Abbreviated syntax: none

The following-sibling axis

Figure: the following-sibling axis.

The following-sibling axis contains all children of the context node’s parent that follow the context node in document order. It can therefore contain only element, text, comment and processing-instruction nodes.

If the context node is the document node, this axis is empty.

The axis is also empty for an attribute context node: attributes are not children of their parent element and are considered unordered, so no unambiguous ordering exists between them, even if the serialized source suggests otherwise.

Example:

following-sibling::*
selects all element nodes, regardless of name, sharing the current node’s parent and following it in document order.

following-sibling::node()
selects all nodes, regardless of kind, following the current node at the same hierarchy level in document order.

   

back to top