Click to return to the XML (Extensible Markup Language) home page    
XMLDOMNodeList length Pro...     XMLDOMNodeList reset Meth...     XMLDOMNodeList Object    
Web Workshop  |  XML (Extensible Markup Language)

nextNode Method


Returns the next node in the collection.

Syntax

objXMLDOMNode = oXMLDOMNodeList.nextNode()

Returns

XMLDomNode object, which refers to the next node in the collection. Returns NULL if there is no next node.

Remarks

The iterator initially points before the first node in the list, so that the first call to nextNode returns the first node in the list.

This method returns NULL when the current node is the last node or there are no items in the list. When the current node is removed from the list, subsequent calls to nextNode return NULL. The iterator must be reset by calling the reset method.

This member is an extension of the W3C DOM.

Example

The following example creates an XMLDOMNodeList object and uses its nextNode property to iterate the collection:

Dim xmlDoc
Dim objNodeList
Dim objNode

Set xmlDoc = CreateObject("microsoft.xmldom")
xmlDoc.async = False
xmlDoc.load("c:\books.xml")
Set objNodeList = xmlDoc.getElementsByTagName("AUTHOR")
For i = 0 TO (objNodeList.length -1)
  Set objNode = objNodeList.nextNode
  MsgBox objNode.text
Next

Applies To

[ Object Name ]
PlatformVersion
Win16:
Win32:
Mac:
Unix:
WinCE:
XMLDOMNamedNodeMap, XMLDOMNodeList


Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.