IXMLDOMNodeList.reset (Visual Basic .NET)

banner art

Previous Next

IXMLDOMNodeList.reset (Visual Basic .NET)

The reset method resets the iterator in the collection of nodes.

Syntax

  IXMLDOMNodeList
  .reset

Parameters

This method contains no parameters.

Return Values

This method does not return a value.

Remarks

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

This method is an extension of the World Wide Web Consortium (W3C) Document Object Model (DOM).

Example Code

The following example creates an IXMLDOMNodeList object and iterates through 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.

Imports interop_msxml
Imports Microsoft.WindowsMediaServices.Interop

On Error GoTo Err

' Declare variables.
Dim Server As New WMSServerClass()
Dim Playlist As IXMLDOMDocument
Dim objNodeList As IXMLDOMNodeList
Dim objNode As IXMLDOMNode

' Create a new playlist object.
Set Playlist = Server.CreatePlaylist

' Load a playlist.
Playlist.Load (("file://c:\wmpub\wmroot\simple.wsx"))

' Retrieve a list of media elements that matches the query.
Set objNodeList = Playlist.getElementsByTagName("media")

' Retrieve each node in the list.
For i = 0 To (objNodeList.length - 1)
  Set objNode = objNodeList.nextNode
Next

' Reset the iterator so that the following
' call to nextNode() returns the first node
' in the list.
objNodeList.Reset
Set objNode = objNodeList.nextNode
Exit Sub

Err:
' TODO: Handle errors.

Requirements

Reference: Add references to Microsoft.WindowsMediaServices and interop_msxml.

Namespace: Microsoft.WindowsMediaServices.Interop, interop_msxml.

Assembly: Microsoft.WindowsMediaServices.dll, interop_msxml.dll.

Library: WMSServerTypeLib.dll, msxml.dll.

Platform: Windows Server 2003 family, Windows Server 2008 family.

See Also

Previous Next