XMLTools.Update
Update an XML node that you specify. This function accepts the following parameters:
Parameter | Description | Required |
---|---|---|
XML text | A valid XML string. | yes |
XPath text | The XML node to update. Do not include the root. | yes |
New value | The new value of the XML node. | yes |
Example
var xml = XMLTools.Update(
"<root> <s>hello world</s> <i>1</i> <o><k>v</k></o> <a>1</a> <a>2</a> <a><o><k>v</k></o></a> </root>",
"./a[3]",
"change_value"
);
Example output
"<root> <a> <b>-1</b> </a> <key>Hello World</key> </root>"
Updated 13 days ago