RelativeLocationPath

Select nodes on a relative location path starting at the context node.


Syntax

RelativeLocationPath

Step ( ( / | // ) Step )*

Description

A RelativeLocationPath consists of a sequence of one or more location steps (Step) separated by one of the path operators / or //. The operator / selects the child nodes of the context node, while // selects all descendant nodes of the context node, since it is an abbreviation for the full XPath expression descendant-or-self::node().

Compatibility

It corresponds to the expression RelativeLocationPath defined in XPath, Section 2.4, Rule 3.

Examples

  • Select all patients (a RelativeLocationPath consisting of a single AbbreviatedStep: it selects the child nodes of the context node, which are the patient element nodes)

    patient
  • Select all doctors who discharged a patient (a RelativeLocationPath that selects every doctor element node which is a child of a discharged element node which is a child of a result element node which is a child of a patient element node which is a child of the context node):

    patient/result/discharged/doctor
  • Select all therapies (an abbreviated RelativeLocationPath that selects every medication element node which is a child of a therapy element node which is a descendant of the context node):

    .//therapy/medication

Related Expressions

Step