Axis

Direction of movement on a path.


Syntax

Axis

graphics/Axis.png

Description

An Axis determines the direction of movement, when a step on a path is taken, beginning at the context node. In the reverse direction, you can address the following axis:

AxisParent parent::
AxisAncestor ancestor::

In the forward direction, you can address the following axes:

AxisChild child::
AxisDescendant descendant::
AxisAttribute attribute::
AxisSelf self::
AxisDescendantOrSelf descendant-or-self::

For all axes except the ancestor and descendant axes there is an abbreviated syntax. See AbbreviatedStep for details.

Example

  • Select all books published in the 21st century:

    input()/descendant::book[attribute::year > 2000 ]

    Starting from the document node, this query looks for any descendant book elements. In the predicate expression the attribute axis is searched for an attribute year whose numerical value is larger than 2000.

Related Syntax Constructs

The following construct(s) refer to this construct:

This construct is also related to the following construct(s):

AbbreviatedStep NodeTest StepExpr StepQualifiers