DOM
Expand Minimize

length Property (IXMLDOMCharacterData)

Specifies the length, in characters, of the data.

lValue = oXMLDOMCharacterData.length;

Example

The following example creates an IXMLDOMComment object and then assigns the length property to a variable.

var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.3.0");
var comment;
var lValue;
xmlDoc.async = false;
xmlDoc.load("books.xml");
if (xmlDoc.parseError.errorCode != 0) {
   var myErr = xmlDoc.parseError;
   WScript.Echo("You have error " + myErr.reason);
} else {
   comment = xmlDoc.createComment("Hello World!");
   lValue = comment.length;
   WScript.Echo(lValue);
}


lValue = oXMLDOMCharacterData.length

HRESULT get_length(
    long *dataLength);

Parameters

dataLength[out, retval]

The length, in Unicode characters, of the string present in the data property.

C/C++ Return Values

S_OK

The value returned if successful.

E_INVALIDARG

The value returned if the dataLength parameter is Null.

Long integer. The property is read-only. It specifies the length, in Unicode characters, of the string present in the data property.

Implemented in:

MSXML 3.0, MSXML 6.0

Show:
© 2014 Microsoft