IXMLDOMNode.ownerDocument (Visual Basic .NET)

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 (Visual Basic .NET), and then displays that object's root element tag name.

Imports interop_msxml
Imports Microsoft.WindowsMediaServices.Interop

On Error GoTo Err

' Declare variables.
Dim Server As New WMSServerClass()
Dim Playlist As IXMLDOMDocument
Dim currNode As IXMLDOMNode
Dim owner As IXMLDOMDocument

' Create a new playlist object.
Set Playlist = Server.CreatePlaylist

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

' Retrieves the second child node of the first child node
' in the root element.
Set currNode = Playlist.documentElement.childNodes.Item(0).childNodes.Item(1)

' Display the owner document's root element tag name.
Set owner = currNode.ownerDocument
MsgBox owner.documentElement.tagName
Exit Sub

' TODO: Handle errors.


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 (Visual Basic .NET)

IXMLDOMNode Object (Visual Basic .NET)


XML DOM Properties (Visual Basic .NET)