Microsoft XML SDK 2.6 - XML Reference

XMLDOMComment Object

Represents the content of an XML comment.

Remarks

The content refers to all characters between the starting <!-- and ending --> tags.

This object has no unique properties or methods of its own, but exposes the same objects and properties as the XMLDOMCharacterData object.

Example

The following VBScript example creates a new XMLDOMComment object (comment) and appends it as the last child node of the DOMDocument object:

Dim xmlDoc
Dim root
Dim comment
Set xmlDoc = CreateObject("Msxml2.DOMDocument")
xmlDoc.async = False
xmlDoc.load("c:\books.xml")
Set root = xmlDoc.documentElement
Set comment = xmlDoc.createComment("Hello World!")
root.appendChild comment
MsgBox (root.xml)

See Also

Properties, Methods, and Events

XMLDOMElement Object