Object Attr CDATASection
CharacterData Comment Document DocumentFragment
DocumentType Entity EntityReference Node
Notation ProcessingInstruction Text
Object.nodeValue
The nodeValue property contains the value of the node, depending on type. The values
returned by each node type are detailed below.
The following example uses the 'names.xml' file and obtains the node values
of the last child node of the document's root node (the last 'name' tag), and that
node's first child node (the text itself).
XML:
<names>
<name>Alice</name>
<name>Bert</name>
<name>Charlie</name>
<name>Diane</name>
<name>Eric</name>
</names>
Code (VBScript):
Set objXMLDoc = CreateObject("Microsoft.XMLDOM")
objXMLDoc.async = False
objXMLDoc.load("names.xml")
Set objNode = objXMLDoc.documentElement.lastChild
document.write(objNode.nodeValue)
Set objNode = objNode.firstChild
document.write("<br>" & objNode.nodeValue)
Output:
null
Eric
|