IXMLDOMNode Object (Visual Basic .NET)

The IXMLDOMNode object provides methods that represent the core functionality of any node. For more information, see the Microsoft XML SDK 3.0 documentation available at the Microsoft Web site.

The IXMLDOMNode object supports the following properties and methods.

Property

Description

attributes

Contains the list of attributes for this node. Read-only.

childNodes

Contains a node list containing the children (for nodes that can have children). Read-only.

firstChild

Contains the first child of this node. Read-only.

lastChild

Contains the last child of this node. Read-only.

nextSibling

Contains the next sibling of this node in the parent's child list. Read-only.

nodeName

Contains the qualified name of the element, attribute, or entity reference, or a fixed string for other node types. Read-only.

nodeType

Specifies the XML DOM node type, which determines valid values and whether the node can have child nodes. Read-only.

nodeTypeString*

Contains the node type in string form. Read-only.

nodeValue

Contains the text associated with the node. Read/write.

ownerDocument

Returns the root of the document that contains this node. Read-only.

parentNode

Contains the parent node (for nodes that can have parents). Read-only.

previousSibling

Contains the left sibling of this node. Read-only.

* Denotes an extension to the W3C DOM.

Method

Description

appendChild

Appends the supplied new child as the last child of this node.

cloneNode

Creates a new node that is an exact clone of this node.

hasChildNodes

Returns a Boolean value indicating whether this node has children.

insertBefore

Inserts a child node before the specified node or at the end of the list.

removeChild

Removes the specified child node from the list of children and returns it.

replaceChild

Returns the specified old child node and replaces it with the supplied new child node.

Example

The following example creates an IXMLDOMNode object and displays the node name for that node.

Imports interop_msxml
Imports Microsoft.WindowsMediaServices.Interop

On Error GoTo Err

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

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

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

' Retrieve the first node and display the node name.
Set Node = Playlist.documentElement.childNodes.Item(0)
MsgBox Node.nodeName
Exit Sub

Err:
' TODO: Handle errors.

See Also

Reference

IXMLDOMDocument Object (Visual Basic .NET)