Update node
Change the text (or an attribute) of every element a path finds, in a file, in XML text or in a session.
Command in the XML toolkit · id ooa.xml/set_value · 9 inputs (1 required), 2 outputs
Inputs
| Input | Type | Required | Default | What it is |
|---|---|---|---|---|
| Path | File | No | XML file (or use xml). | |
| XPath | String | Yes | XPath of the nodes to change. | |
| Value | String | No | New text (or the attribute's new value). | |
| Save to | File | No | Save to another file instead of overwriting. | |
| Attribute | String | No | Set this attribute (created when missing) instead of the node text. | |
| XML | String | No | XML text to change instead of a file; the result is in the xml output. | |
| Attributes | Dictionary | No | Several attributes to set at once, as name to value (created when missing). With these, the node text changes only when value is filled in. | |
| 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 |
|---|---|---|
| count | Number | Nodes changed. |
| xml | String | The XML after the change. |