IXMLDOMNode.ownerDocument (Visual Basic .NET)

banner art

Previous Next

IXMLDOMNode.ownerDocument (Visual Basic .NET)

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

Syntax

  IXMLDOMDocument = IXMLDOMNode.ownerDocument

Remarks

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

Example Code

The following example uses the ownerDocument property to return the parent IXMLDOMDocument object, 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

Err:
' TODO: Handle errors.

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