length Property (IXMLDOMCharacterData)
Specifies the length, in characters, of the data.
Script Syntax
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);
}
Visual Basic Syntax
lValue = oXMLDOMCharacterData.length
C/C++ Syntax
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.
Remarks
Long integer. The property is read-only. It specifies the length, in Unicode characters, of the string present in the data property.
Versioning
Implemented in:
MSXML 3.0, MSXML 6.0
Applies to
IXMLDOMCDATASection | IXMLDOMCharacterData | IXMLDOMComment | IXMLDOMText