IXMLDOMNodeList object

The IXMLDOMNodeList object refers to a list of IXMLDOMNode objects. An IXMLDOMNodeList object immediately reflects changes made to the nodes in the list.

Creating a node list

Use the selectNodes method to create an IXMLDOMNodeList object that contains all of the nodes matching a specified pattern. The following example uses XPath as the selection language to search for all of the Seller_First_Name elements.

{Specify XPath as the selection language.}
xmlDoc.setProperty("SelectionLanguage", "XPath");
{Retrieve all of the instances of a Seller_First_Name element.}
nodeList = element.selectNodes("Seller_First_Name");

You may use either the XSLPattern or XPath selection languages to specify the pattern you want to search an element for. For more information on specifying the selection language, refer to DOMDocument object.

Retrieving the size of a node list

Use the length property to retrieve the size of a node list.

{Retrieve the size of the node list.}
dataLength = nodeList.length;

Retrieving a node

You can retrieve an object from an IXMLNodeList object with the item method by the index associated with the object.

{Retrieve the fifth node from the node list.}
node = nodeList.item[5];

You can also access all of nodes in the list sequentially with the nextNode method.

{Loop through the nodes in the node list and remove them from the document.}
for i=1 to nodeList.length do
	node = nodeList.nextNode();
end for;

Use the reset method to allow the nextNode method to return the first node in the list.

{Reset the node list to the beginning.}

Documentation Feedback