A location step has the form
axis :: node-test [ predicate ]
The candidates that survive the filtration constitute the
- The axis selects a set of candidate nodes (e.g. the
child nodes of the context node).
- The node-test performs an initial filtration of the
candidates based on their
- types (chardata node, processing instruction, etc.), or
- names (e.g. element name).
- The predicates (zero or more) cause a further, potentially more
Only candidates for which the predicates
evaluate to true are kept.
This structure of location paths and steps makes implementation rather easy.
The example from before:
selects all href attributes in cite elements in the
first 5 sections of an article.