IXMLDOMNode.ownerDocument (C#)

The ownerDocument property returns the root of the document that contains the node.

IXMLDOMDocument = IXMLDOMNode.ownerDocument;


The property is read-only. It returns the parent document that represents the root of the document to which this node belongs.


The following example uses the ownerDocument property to return the parent IXMLDOMDocumentIXMLDOMDocument Object (C#), and then displays that object's root element tag name.

using Microsoft.WindowsMediaServices.Interop;
using interop_msxml;

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

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 first child node
    // in the root element.
    currNode = Playlist.documentElement.childNodes[0].childNodes[1];

    // Display the owner document's root element tag name.
    Owner = currNode.ownerDocument;
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


IXMLDOMDocument Object (C#)

IXMLDOMNode Object (C#)


XML DOM Properties (C#)