Skip to content

XML Activities

Version: 1.0.0  ·  ID: zoan-packages-xml  ·  Author: Zoan Software

The XML package reads, queries and modifies XML documents, a data exchange format widely used in integrations (electronic billing, SOAP web services, configurations, healthcare files). It allows you to extract data from an XML and modify it without having to parse the text by hand.

Activities work on XML text (a string), not on an open file. The typical pattern is:

  1. Read XML reads the file and returns its contents as string.
  2. You query values with XML Query Text / XML Query All, or modify them with XML Set Value / XML Add Element (which return the modified XML).
  3. Write XML saves the result to a file.
Read XML path = = ruta → output: xml
XML Query Text xml = = xml xpath = "//Factura/Total" → output: total
XPathSelect
//NumeroAll <Numero> items at any level
//Factura/NumeroThe <Numero> direct children of <Factura>
//Factura[@id='5']The <Factura> with attribute id="5"
//Item[2]The second <Item>
ActivityTypeOutputWhat it does
Read XMLxml-readstringRead an XML file as text
Write XMLxml-writestringSave XML text to a file
XML Query Textxml-query-textstringFirst value that matches an XPath
XML Query Allxml-query-allListAll values that match
XML Set Valuexml-set-valuestringChange the value of an element
XML Add Elementxml-add-elementstringAdd a child element