XML Query Text
XML Query Text
Section titled “XML Query Text”Type: xml-query-text · Package: XML Activities v1.0.0 · Output: string
Evaluates an XPath expression over an XML and returns the first text value that matches. It is the way to extract data from an XML document: the number of an invoice, the name of a patient, a total.
How it works
Section titled “How it works”Applies the xpath to the xml and returns the text of the first matching element (empty if there is none). See XPath in a scoop.
Required parameters
Section titled “Required parameters”| Parameter | Editor | Description |
|---|---|---|
xml | expression | The XML text (from Read XML). |
xpath | expression | The XPath expression, e.g. //Factura/Numero. |
Optional parameters
Section titled “Optional parameters”Ninguno.
Output
Section titled “Output”Returns a string with the first matching value.
Example
Section titled “Example”Read XML path = = ruta → output: xmlXML Query Text xml = = xml xpath = "//Factura/Total" → output: totalLog message = = "Total de la factura: " + totalRelated activities
Section titled “Related activities”- XML Query All — return all matching values.
- Read XML — load the document.