Microsoft XML SDK 2.6 - XML Reference

length Property (XMLDOMNodeList)

Indicates the number of items in the collection.

lValue = oXMLDOMNodeList.length

Remarks

Long integer. The property is read-only.

Example

The following VBScript example creates an XMLDOMNodeList object and then uses its length property to support iteration:

Dim xmlDoc
Dim objNodeList
Set xmlDoc = CreateObject("Msxml2.DOMDocument")
xmlDoc.async = False
xmlDoc.load("c:\xmlinact\books.xml")
Set objNodeList = xmlDoc.getElementsByTagName("AUTHOR")
For i=0 To (objNodeList.length -1)
  MsgBox (objNodeList.item(i).text)
Next

See Also

Applies To: XMLDOMNodeList Object | XMLDOMSelection Object