IXMLDOMNamedNodeMap.removeNamedItem (C#)
Previous | Next |
IXMLDOMNamedNodeMap.removeNamedItem (C#)
The removeNamedItem method removes an attribute from the collection.
Syntax
IXMLDOMNode = IXMLDOMNamedNodeMap .removeNamedItem( string strName );
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.
using Microsoft.WindowsMediaServices.Interop; using interop_msxml; // Declare variables. WMSServer Server; IXMLDOMDocument Playlist; IXMLDOMElement Elem; IXMLDOMNodeList ChildList; IXMLDOMNamedNodeMap XMLNamedNodeMap; IXMLDOMNode XMLNode; try { // Create a new WMSServer object. Server = new WMSServerClass(); // Create a new playlist object. 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[0].attributes; // Remove an attribute named "src". XMLNode = XMLNamedNodeMap.removeNamedItem("src"); } catch (Exception e) { // TODO: Handle exceptions. }
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 |