Share via


IXMLDOMNamedNodeMap.nextNode (C#)

banner art

Previous Next

IXMLDOMNamedNodeMap.nextNode (C#)

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

Syntax

  IXMLDOMNode = IXMLDOMNamedNodeMap
  .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 IXMLDOMNamedNodeMap object and uses its nextNode method to iterate the collection.

using Microsoft.WindowsMediaServices.Interop;
using interop_msxml;

// Declare variables.
WMSServer Server;
IXMLDOMDocument Playlist;
IXMLDOMNamedNodeMap objNamedNodeMap;
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 the list of attribute nodes in the second child node.
    objNamedNodeMap = Playlist.documentElement.childNodes[1].attributes;

    // Retrieve each node in the list.
    for(int i = 0; i < objNamedNodeMap.length; i++)
    {
        objNode = objNamedNodeMap.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