Click to return to the XML (Extensible Markup Language) home page    
XMLDOMCharacterData appen...     XMLDOMCharacterData delet...     XMLDOMCharacterData Objec...    
Web Workshop  |  XML (Extensible Markup Language)

data Property


Contains this node's data, which depends on the node type.

Syntax

strValue = oXMLDOMCharacterData.data
objXMLDOMCharacterData.data = strValue

Remarks

String. The property is read/write. It contains the same value as the nodeValue for this node. The meaning of the value depends on the XMLDOMNode object's nodeType property, as follows:

NODE_CDATA_SECTION
A string representing the text stored in the CDATA section.
NODE_COMMENT
The content of the comment, exclusive of the comment begin and end sequence.
NODE_TEXT
A string representing the text stored in the text node.

Example

The following VBScript example walks the document tree and checks for comment node types. If one is found, it displays its contents with the  data property:

Dim xmlDoc
Dim comment
Dim root

Set xmlDoc = CreateObject("microsoft.xmldom")
xmlDoc.async = False
xmlDoc.load("c:\books.xml")
Set root = xmlDoc.documentElement
  For i = 0 To (root.childNodes.length -1)
    If (root.childNodes.item(i).nodeType = 8) Then
      MsgBox (root.childNodes.item(i).data)
    End If
  Next

Applies To

[ Object Name ]
PlatformVersion
Win16:
Win32:
Mac:
Unix:
WinCE:
XMLDOMCDATASection, XMLDOMCharacterData, XMLDOMComment, XMLDOMText


Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.