IXMLDOMNode.previousSibling (C#)

The previousSibling property contains the previous sibling of this node in the parent's child list.

IXMLDOMNode = IXMLDOMNode.previousSibling;


The property is read-only.

The value of the IXMLDOMNodeIXMLDOMNode Object (C#) returned depends on the type of node on which the previousSibling 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 node that immediately precedes that element node.

Node type

Value returned


Always returns NULL; these node types do not appear as children of any other nodes.


Returns the node immediately preceding this node in its parent's child list. Returns NULL if no such node exists.


The following example creates an IXMLDOMNode object and sets it to the previous sibling of the current node.

using Microsoft.WindowsMediaServices.Interop;
using interop_msxml;

// Declare variables.
WMSServer Server;
IXMLDOMDocument Playlist;
IXMLDOMNode currNode;
IXMLDOMNode prevNode;

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

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

    // Load a playlist.

    // Retrieve the second child node of the root element.
    currNode = Playlist.documentElement.childNodes[1];

    // Retrieve the previous sibling.
    prevNode = currNode.previousSibling;
catch (Exception e) {
    // TODO: Handle exceptions.


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


IXMLDOMNode Object (C#)


XML DOM Properties (C#)