The axis is a filter. It filters based on the relationship between the nodes selected to the context node. It is based on the position of the node in the tree.
Selects the ancestors of the current context.
//td[.="Bravo"]/ancestor::tr
Selects the ancestors and includes the current context node.
//td[.="Bravo"]/ancestor-or-self::td
The attribute axis selects the attributes of the nodes in the current context.
/table/tr/attribute::class
The child axis selects the immediate child nodes of the current context.
/table/tr/child::td
The descendant axis selects descendant nodes of the current context.
/table/tr/descendant::table
The descendant-or-self axis selects the nodes which are descendants of the current context, including nodes from the current context.
/table/tr/td/descendant-or-self::td
The following axis selects nodes that follows after the current context. It does not include descendants, attribute nodes and namespace nodes.
//td[.="Bravo"]/following::*
The following-sibling axis selects siblings which follows after the current context. It excludes children nodes that appear before the current context.
/table/tr[2]/following-sibling::*
The namespace axis selects the namespace node of the current context.
/*/namespace::*[name()='']
The parent axis selects the parent of the current context. The parent is the immediate node preceding the current context. It is different from ancestors which includes nodes at multiple levels preceding the current context.
//td[.="Bravo"]/parent::*
The preceding axis selects elements that precedes the current context. It does not include ancestors, attribute nodes and namespace nodes.
//td[.="Bravo"]/preceding::*
The preceding-sibling axis selects siblings which precedes the current context. It excludes children nodes that appear after the current context.
/table/tr[2]/preceding-sibling::*
The self axis selects the current context node.
/table/tr[2]/self::*