IXMLDOMNode.removeChild (Visual Basic .NET)

banner art

Previous Next

IXMLDOMNode.removeChild (Visual Basic .NET)

The removeChild method removes the specified child node from the list of children and returns it.

Syntax

  IXMLDOMNode = IXMLDOMNode
  .removeChild(
  objchildNode As Object
)

Parameters

objchildNode

[in] Object containing the child node to be removed from the list of children of this node.

Return Values

Returns the removed child node.

Example Code

The following example retrieves a child node and removes a node from its list of children.

Imports interop_msxml
Imports Microsoft.WindowsMediaServices.Interop

On Error GoTo Err

' Declare variables.
Dim Server As New WMSServerClass()
Dim Playlist As IXMLDOMDocument
Dim root As IXMLDOMElement
Dim currNode As IXMLDOMNode
Dim oldChild As IXMLDOMNode

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

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

' Retrieve the root element.
Set root = Playlist.documentElement

' Retrieve the second child of the current node.
Set currNode = root.childNodes.Item(1)

' Remove child of the current node.
Set oldChild = currNode.removeChild(currNode.childNodes.Item(1))
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