appendData Method
TOC
Collapse the table of content
Expand the table of content

appendData Method

 

Appends the supplied string to the existing string data.

oXMLDOMCharacterData.appendData(data);

 data 

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

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);
}

Hello... ... World!

HRESULT appendData(
    BSTR data);

 data[in]

The string data to be appended to the existing string.

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

Show:
© 2016 Microsoft