January 2003
Beginner to intermediate
1200 pages
23h 42m
English
You use the XMLDOMNodeList to handle lists of nodes, and node lists are useful because a node can itself have many child nodes. Using a node list, you can handle all the children of a node at once.
For example, here I'm loading a document and getting a list of all <PERSON> elements as a node list, using the document object's getElementsByTagName method:
function readXMLDocument()
{
var xmldoc, nodeList
xmldoc = new ActiveXObject("Microsoft.XMLDOM")
xmldoc.load("ch07_01.xml")
nodeList = xmlDoc.getElementsByTagName("PERSON")
.
.
.
Here is the base set of properties for the XMLDOMNodeList object:
length— Number of items in the collection. Read-only.
Here is the base set of methods for the XMLDOMNodeList object:
item