IXMLDOMElement.removeAttribute (Visual Basic .NET)

banner art

Previous Next

IXMLDOMElement.removeAttribute (Visual Basic .NET)

The removeAttribute method removes or replaces the named attribute.


  strName As String



[in] String specifying the name of the attribute to be removed or replaced.

Return Values

This method does not return a value.

Example Code

The following example removes the attribute node named "src" from the specified element node.

Imports interop_msxml
Imports Microsoft.WindowsMediaServices.Interop

On Error GoTo Err

' Declare variables.
Dim Server As New WMSServerClass()
Dim Playlist As IXMLDOMDocument
Dim ElemList As IXMLDOMNodeList
Dim Elem As IXMLDOMElement
Dim Node As IXMLDOMNode

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

' Load a playlist.

' Retrieve a list of nodes that matches the query.
ElemList = Playlist.getElementsByTagName("media")

' Retrieve the first node in the list.
Node = ElemList.item(0)

' Convert the first node into an IXMLDOMElement object.
Elem = CType(Node, IXMLDOMElement)

' Remove the attribute named "src".
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

Previous Next