XPath specifies path expressions that match XML data by navigating down (and occasionally up or across) the tree and possibly evaluating conditions over data in the tree.
Some basic constructs (very incomplete list):
/ | root element, or separator between steps in path |
X | matches element X |
* | matches any element |
@X | matches attribute X of the current element ("context node") |
// | matches all descendants of the current element, including self |
[C] | evaluates condition C on the current element |
[N] | picks the Nth matching element |
Path1 | Path2 | union of Path1 and Path2 results
|
contains(s1,s2) | returns TRUE if string s1 contains string s2
|
name() | returns tag of the current element |
parent:: | matches the parent of the current element, if there is one |
following-sibling:: | matches all later siblings of the current element |
descendants:: | matches all descendants of the current element |
self:: | matches the current element |
//
FOR Specify documents, set up iterator variables LET Set up other variables, usually for aggregation or common subqueries WHERE Filtering condition ORDER Sort results RETURN What to return
<Result> { ... the query here
... } </Result>
Constructs covered:
Constructs covered: