Specifications

Location paths
A location path is a sequence of one or more location steps separated by a slash. Each location
step in turn (from left to right) selects a set of nodes relative to the context node determined by
the previous step. The initial context node is determined by the location path's context (for the
data model queries in Switch this is always the document's root node; in the XML module it is
the node being queried). A slash in front of a location path makes the location path absolute,
that is, the "/" refers to the root node of the document.
Here are some examples of location paths:
para
selects the para element children of the context node
*
selects all element children of the context node
text()
selects all text node children of the context node
@name
selects the name attribute of the context node
@*
selects all the attributes of the context node
para[1]
selects the first para child of the context node
para[last()]
selects the last para child of the context node
*/para
selects all para grandchildren of the context node
/doc/chapter[5]/section[2]
selects the second section element in the fifth chapter element in the doc document element
chapter//para
selects the para element descendants of the chapter element children of the context node
//para
selects all the para descendants of the document root and thus selects all para elements in the
same document as the context node
//olist/item
selects all the item elements in the same document as the context node that have an olist parent
.
selects the context node
.//para
selects the para element descendants of the context node
..
328
Enfocus Switch 10