Axes

Abstract

Overview of the axis component of a query.

The axis component of a query determines the direction of the node selection in relation to the context node. An axis can be thought of as a directional query.

Note

The axis component of a query is not scalable when using item buckets and a large number of content items.

The following table lists some common axes:

Axes

Description

ancestor

Returns all the ancestors of the context item (same as XPath).

ancestor-or- self

Returns the context item and all the ancestors of the context item (same as XPath).

child

(/*) returns all the children of the context item (same as XPath).

descendant

(//*) returns all the descendants of the context item; a descendant is a child or a child of a child and so on (same as XPath).

descendant- or-self

Returns the context item and all the descendants of the context item (same as XPath).

following

Returns all the following siblings of the context node (same as following-sibling in XPath).

parent

(..) returns the parent item of the context item (same as XPath).

preceding

Returns all the preceding siblings of the context item (same as preceding-sibling in XPath).

self

(.) returns the context item (same as XPath).

[int]

Returns the child item with the specified index.