Evaluate XPath
Work something out from XML with an XPath function, such as count(//line) or sum(//amount): text, a number or true/false.
Command in the XML toolkit · id ooa.xml/xpath_function · 6 inputs (1 required), 1 output
Inputs
| Input | Type | Required | Default | What it is |
|---|---|---|---|---|
| Expression | String | Yes | XPath expression. | |
| XML | String | No | XML text (or use path). | |
| Path | File | No | XML file (or use xml). | |
| Result type | String | No | string | Type of the result. |
| Namespaces | Dictionary | No | Prefix to namespace URI for prefixes in the XPath, e.g. {"inv": "urn:example:invoice"}; prefixes declared in the document work without this. Map a default namespace (xmlns="...") to a prefix of your choice to address it; a prefix with an empty URI, e.g. {"d": ""}, stands for the document's own default namespace. | |
| Session | String | No | Work on the XML of this session (Start session) instead of a file or text; changes stay in the session until End session saves them. |
Outputs
| Output | Type | What it is |
|---|---|---|
| result | Any | Result of the expression as String, Number or Boolean. |