Share via


IXMLDOMNodeList.nextNode (C#)

banner art

Previous Next

IXMLDOMNodeList.nextNode (C#)

The nextNode method returns the next node in the IXMLDOMNodeList collection.

Syntax

  IXMLDOMNode = IXMLDOMNodeList
  .nextNode;

Parameters

This method takes no parameters.

Return Values

Returns an IXMLDOMNode object that 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.

using Microsoft.WindowsMediaServices.Interop;
using interop_msxml;

// Declare variables.
WMSServer Server;
IXMLDOMDocument Playlist;
IXMLDOMNodeList NodeList;
IXMLDOMNode objNode;

try {
    // Create a new WMSServer object.
    Server = new WMSServerClass();

    // Create a new playlist object.
    Playlist = Server.CreatePlaylist();

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

    // Retrieve a list of nodes that match the query.
    NodeList = Playlist.getElementsByTagName("media");

    // Retrieve each node in the list.
    for(int i = 0; i < NodeList.length; i++)
    {
        objNode = NodeList.nextNode();
    }
}
catch (Exception e) {
    // TODO: Handle exceptions.
}

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