XML Set Value
XML Set Value
Section titled “XML Set Value”Type: xml-set-value · Package: XML Activities v1.0.0 · Output: string
Change the text value of the first element that matches an XPath and return the modified XML. Use it to update data in an XML document: a status, a date, an amount.
How it works
Section titled “How it works”Locates the first element that matches xpath in xml, puts the new value in it, and returns the complete modified XML (as a string). Remember to save the result with Write XML.
Required parameters
Section titled “Required parameters”| Parameter | Editor | Description |
|---|---|---|
xml | expression | The XML text. |
xpath | expression | XPath to the element to update. |
value | expression | The new value. |
Optional parameters
Section titled “Optional parameters”Ninguno.
Output
Section titled “Output”Returns a string with the modified XML.
Example
Section titled “Example”Read XML path = = ruta → output: xmlXML Set Value xml = = xml xpath = "//Factura/Estado" value = "Pagada" → output: xmlNuevoWrite XML path = = ruta content = = xmlNuevoRelated activities
Section titled “Related activities”- XML Add Element — add a new element.
- Write XML — save the result.