Using xpath expression language in Dovetail
Xpath expression is supported by the following components:
Selecting nodes
General
| Expression | Description |
|---|---|
nodename | Selects all nodes with the name "nodename" |
/ | Selects from the root node |
// | Selects nodes in the document from the current node that match the selection no matter where they are |
. | Selects the current node |
.. | Selects the parent of the current node |
@ | Selects attributes |
Things to keep in mind
- Use
*:to ignore namespaces
Examples
This xml is used in the examples below.
<?xml version="1.0" encoding="utf-8"?>
<orders>
<order>
<header orderid="123">
<ordernr>12345</ordernr>
<datetime>2019-04-27T08:58:40.375Z</datetime>
</header>
<orderlines>
<orderline>
<item>1</item>
<value>50</value>
</orderline>
<orderline>
<item>2</item>
<value>100</value>
</orderline>
<orderline>
<item>3</item>
<value>150</value>
</orderline>
</orderlines>
</order>
</orders>