1 out of 2 rated this helpful - Rate this topic

appendData Method

Appends the supplied string to the existing string data.

oXMLDOMCharacterData.appendData(data);

Parameters

data

A string containing the data that is to be appended to the existing string.

Example

The following script example creates an IXMLDOMComment object and uses the appendData method to add text to the string.

var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.6.0");
var comment;
xmlDoc.async = false;
xmlDoc.loadXML("<root></root>");
if (xmlDoc.parseError.errorCode != 0) {
   var myErr = xmlDoc.parseError;
   WScript.Echo("You have error " + myErr.reason);
} else {
   comment = xmlDoc.createComment("Hello...");
   comment.appendData(" ... World!");
   WScript.Echo(comment.data);
}

Output

 
Hello... ... World!
HRESULT appendData(
    BSTR data);

Parameters

data[in]

The string data to be appended to the existing string.

Return Values

S_OK

The value returned if successful.

S_FALSE

The value returned if the string is not appended.

E_FAIL

The value returned if an error occurs.

The length property is also updated by this operation.

Implemented in: MSXML 3.0 and MSXML 6.0

Did you find this helpful?
(1500 characters remaining)