/
'
and relative path starts with a step.The syntax for a step is:
axis-name::node-test[predicate] |
Axis Name | Result |
---|---|
ancestor |
Selects all ancestors (parent, grandparent, etc.) of the current node |
ancestor-or-self |
Selects all ancestors (parent, grandparent, etc.) of the current node and the current node itself |
attribute |
Selects all attributes of the current node |
child |
Selects all children of the current node |
descendant |
Selects all descendants (children, grandchildren, etc.) of the current node |
descendant-or-self |
Selects all descendants (children, grandchildren, etc.) of the current node and the current node itself |
following |
Selects everything in the document after the closing tag of the current node |
following-sibling |
Selects all siblings after the current node |
parent |
Selects the parent of the current node |
preceding |
Selects everything in the document that is before the start tag of the current node |
preceding-sibling |
Selects all siblings before the current node |
self |
Selects the current node |
Node Test | Result |
---|---|
nodename |
Selects attribute nodes or child element nodes with the specified name; |
text() |
Selects all text nodes among the children of the current node; |
comment() |
Selects all comment nodes among the children of the current node; |
data() |
Selects all data nodes among the children of the current node; text node is a special kind of data node; |
node() |
Selects all children of the current node; |
Expression | Description |
---|---|
name |
Selects all child elements with the specified name, as child axis is the default axis in Candle. |
/ |
Selects the root node |
// |
Selects descendant nodes of the current node and the current node itself |
. |
Selects the current node |
.. |
Selects the parent of the current node |
@ |
Shorthand for attribute axis |
* |
Selects all child element nodes regardless of its name |
*:name |
Selects any child elements with the specified local name, regardless its namespace |
namespace:* |
Selects any child elements under the specified namespace |
@* |
Selects all attribute nodes regardless of its name |
@*:name |
Selects any attribute nodes with the specified local name, regardless its namespace |
@namespace:* |
Selects any attribute nodes under the specified namespace |
Predicates | Description |
---|---|
step[predicate-expr] |
The filter predicate is used to filter the nodes selected by the path step. If the predicate expression evaluates to an integer, it selects the Nth node among the nodes based on the integer value; otherwise, the result is casted into the effective boolean value, and the context node is kept if the boolean is true, and filtered if false. |
step?property |
The property predicate is used to return specific property values of the context item. |
step?routine() |
To invoke a member routine defined on the context item. |