6.3. Location Paths

Location paths are a particular kind of expression that yields a node-set. Because they are so important, we will discuss them first, before general XPath expressions. Two kinds of location paths exist: relative and absolute.

Relative Location Paths

The evaluation of a relative location path occurs relative to some current context node. It consists of one or more location steps. If multiple steps are present, they are separated by slashes (“/”).

The evaluation of these location steps goes from left to right, with the information being passed along consisting of a selected node-set. The node-set fed into the first or leftmost (and possibly only) location step consists of just the context node. The evaluation of a particular ...

Get Secure XML: The New Syntax for Signatures and Encryption now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.