IXMLDOMNode.nextSibling (C#)
Previous | Next |
IXMLDOMNode.nextSibling (C#)
The nextSibling property contains the next sibling of this node in the parent's child list.
Syntax
IXMLDOMNode = IXMLDOMNode.nextSibling;
Remarks
The property is read-only. It returns the next sibling of the current node.
The value of the IXMLDOMNode object returned depends on the type of node on which the nextSibling property is called, as shown in the following table. For example, if the node type is NODE_ELEMENT, an IXMLDOMNode object is returned containing the next node following that element node.
Node type | Value returned |
NODE_ATTRIBUTE NODE_DOCUMENT |
Always returns NULL; these node types do not appear as children of any other nodes. |
NODE_COMMENT NODE_ELEMENT NODE_PROCESSING_INSTRUCTION NODE_TEXT |
Returns the node immediately following this node in the list of children of this node's parent. If no such node exists, it returns NULL. |
Example Code
The following example creates an IXMLDOMNode object and sets it to the next sibling of the current node.
using Microsoft.WindowsMediaServices.Interop; using interop_msxml; // Declare variables. WMSServer Server; IXMLDOMDocument Playlist; IXMLDOMNode currNode; IXMLDOMNode nextNode; 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 first child node of the root element. currNode = Playlist.documentElement.childNodes[0]; // Retrieve the next child node of the root element. nextNode = currNode.nextSibling; } 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 |