IXMLDOMNamedNodeMap.removeNamedItem (Visual Basic .NET)
Previous | Next |
IXMLDOMNamedNodeMap.removeNamedItem (Visual Basic .NET)
The removeNamedItem method removes an attribute from the collection.
Syntax
IXMLDOMNode = IXMLDOMNamedNodeMap .removeNamedItem( strName As String )
Parameters
strName
[in] String specifying the name of the attribute to remove from the collection.
Return Values
Returns the node removed from the collection. Returns NULL if the named node is not an attribute.
Example Code
The following example uses the removeNamedItem method to remove an 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 Elem As IXMLDOMElement Dim ChildList As IXMLDOMNodeList Dim XMLNamedNodeMap As IXMLDOMNamedNodeMap Dim XMLNode As IXMLDOMNode ' Create a new playlist object. Set Playlist = Server.CreatePlaylist ' Load a playlist. Playlist.Load ("file://c:\wmpub\wmroot\simple.wsx") ' Retrieve a pointer to the root element. Elem = Playlist.documentElement ' Retrieve a list of the child nodes. ChildList = Elem.childNodes ' Retrieve the list of attributes for the first ' node in the child node list. XMLNamedNodeMap = ChildList.item(0).attributes ' Remove an attribute named "src". XMLNode = XMLNamedNodeMap.removeNamedItem("src") 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
- IXMLDOMNamedNodeMap Object (Visual Basic .NET)
- IXMLDOMNode Object (Visual Basic .NET)
- XML DOM Methods (Visual Basic .NET)
Previous | Next |