Click to return to the XML (Extensible Markup Language) home page    
XMLDOMNodeList nextNode M...     XMLDOMNodeList Object    
Web Workshop  |  XML (Extensible Markup Language)

reset Method


Resets the iterator.

Syntax

oXMLDOMNodeList.reset()

Remarks

This method reinitializes the iterator to point before the first node in the XMLDOMNodeList object, so that the next call to nextNode returns the first item in the list.

This member is an extension of the W3C DOM.

Example

The following example creates an XMLDOMNodeList object and iterates the collection using the nextNode method. It then uses the reset method to reset the iterator to point before the first node in the list:

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 

objNodeList.reset
Set objNode = objNodeList.nextNode
MsgBox objNode.text

Applies To

[ Object Name ]
PlatformVersion
Win16:
Win32:
Mac:
Unix:
WinCE:
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.