Addressing nodes occurs with the help of a localization path. With localization paths, it is a matter of using an XPath expression to navigate through the tree structure and to choose a desired node set. The node set is the outcome of an XPath expression.
Localization paths are evaluated from left to right. One distinguishes between absolute and relative localization paths. An absolute localization path begins at the document node. In this case, you prefix the XPath expression with a slash (/). Relative localization paths begin at an arbitrary node within the tree structure. This starting point is called the context node.
A localization path consists of individual localization steps that, as is the case when addressing files in the directory system, are separated by a slash (/).
Each localization step consists of up to three parts: the axis, the node test and an arbitrary number of predicates.
- Axis: When choosing the axis, you determine the navigation direction in the tree structure starting from the context or document node.
- Node test: The node test corresponds to a filter with which you limit the notes lying on the axis to the desired node set.
- Predicates: Predicates enable you to again filter the nodes selected through the axis and node test.
The localization path for an XPath expression is notated in accordance with the following syntax: