IXMLDOMNodeList.nextNode (Visual Basic .NET)
IXMLDOMNodeList.nextNode (Visual Basic .NET)
The nextNode method returns the next node in the IXMLDOMNodeList collection.
Syntax
IXMLDOMNode = IXMLDOMNodeList .nextNode
Parameters
This method contains no parameters.
Return Values
Returns an IXMLDOMNode 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 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 uses its nextNode method to iterate the collection.
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 nodes that match 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 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