setData Method

Stores a data string (usually an XML) under dataName.

setData(dataName, dataValue);

 

Parameter

Description

dataName

The desired name of the data value.

dataValue

A string value containing the data. Usually, XML fragment.

Return Value

If the method succeeds, the return value is true. If the method fails, the return value is false. SGWorld.lastError contains the failure reason.

Remarks

The main difference between the setData() method and the setAttribute() method is that setData() can store “complex” strings (usually XML fragments). setAttribute() stores simple string values that must follow the rules of the XML attribute name/value.