LocationPath

Select nodes along a relative or absolute path.


Syntax

LocationPath

RelativeLocationPath | AbsoluteLocationPath

Description

A LocationPath selects a set of nodes either relative to the context node if it is a RelativeLocationPath or relative to the root node if it is an AbsoluteLocationPath. The result of evaluating a location path expression is the node set containing the nodes selected by the location path. Location paths can recursively contain expressions that are used to filter sets of nodes.

Compatibility

It corresponds to the expression LocationPath defined in XPath, Section 2, Rule 1.

Examples

  • Select all patients (using a relative location path select all patient nodes starting from the context node which is the same as the collection's doctype element):

    patient
  • Select all male patients sorted by their first names (using an absolute location path select all patient nodes that have a child element node sex whose value matches the pattern "male"; sort this node-set by the element /patient/name/firstname which must have been defined with Search-Type set to "Standard" in the schema definition):

    /patient[sex ~= 'male'] sortby (./name/firstname)

Related Expressions

AbsoluteLocationPath RelativeLocationPath