DriveWorks Pro 16: SppXmlSetElementValue [send feedback...]

SppXmlSetElementValue

Will change the value of an element within XML data to a new value given.

You can not change Root element values with this function.

Syntax

SppXmlSetElementValue([XML],[Path],[New Element Name],[Value])

Where:

XML is an object such as the returned value from SppXmlLoad or SppXmlFromString.

Path is a full path to the element inside the XML object (For example, Quote\Customer). If the element is part of an Array with the same name, the path would need to use an instance number (For example Quote\Items\Item\6 to return the value for the 6th Item).

New Element name is the new name for the element(s) whose values are set when loaded from an Array. (Not applicable when using a string to set a value.)

Value is the new value for the element. This can be a string or Table Array. If a Table Array is used to add multiple elements with children (one child for each row), then the element name of each child is set to the value entered for New Element Name.

Example

RuleResultMeaning
SppXmlSetElementValue(DWVariableXMLLoad,"Quote\CustomerName",,"My Company Corp.")Will pass the value My Company Corp. into the element CustomerName.

Table of Contents