to the main page... about these slides...

Axes

Available axes:

child   the children of the context node
descendant   all descendants (children, childrens children, ...)
parent   the parent (empty is at the root)
ancestor   all ancestors from the root to the parent
following-sibling   siblings to the right
preceding-sibling   siblings to the left
following   all following nodes in the document
preceding   all preceding nodes in the document
attribute   the attributes of the context node
namespace   namespace declarations in the context node
self   the context node itself
descendant-or-self   the union of descendant and self
ancestor-or-self   the union of ancestor and self

Note that attributes and namespace declarations are considered a special kind of nodes.

Some of these axes assume a document ordering of the tree nodes. The ordering essentially corresponds to a left-to-right preorder traversal of the document tree.

The resulting sets are ordered intuitively, either forward (in document order) or reverse (reverse document order).
For instance, following is a forward axis, and ancestor is a reverse axis.