length Property (IXMLDOMCharacterData)
Specifies the length, in characters, of the data.
[Script]
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.4.0");
var comment;
var lValue;
xmlDoc.async = false;
xmlDoc.load("books.xml");
comment = xmlDoc.createComment("Hello World!");
lValue = comment.length;
alert(lValue);
[Visual Basic]
Visual Basic Syntax
lValue = oXMLDOMCharacterData.length
Example
The following example creates an IXMLDOMComment object and then assigns the length property to a variable.
Dim xmlDoc As New Msxml2.DOMDocument40
Dim comment As IXMLDOMComment
Dim lValue As Long
xmlDoc.async = False
xmlDoc.Load ("books.xml")
Set comment = xmlDoc.createComment("Hello World!")
lValue = comment.length
MsgBox lValue
[C/C++]
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 dataLength 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.
To view reference information for Visual Basic, C/C++, or Script only, click the Language Filter button
in the upper-left corner of the page.
See Also
data Property
Applies to: IXMLDOMCDATASection | IXMLDOMCharacterData | IXMLDOMComment | IXMLDOMText