IXMLDOMNamedNodeMap.removeQualifiedItem (C#)

banner art

Previous Next

IXMLDOMNamedNodeMap.removeQualifiedItem (C#)

The removeQualifiedItem method removes the attribute with the specified namespace and attribute name.

Syntax

  IXMLDOMNode = IXMLDOMNamedNodeMap
  .removeQualifiedItem(
  string strbaseName,
 string strnamespaceURI 
);

Parameters

strbaseName

[in] string specifying the base name of the attribute, without a namespace qualification.

strnamespaceURI

[in] string specifying the namespace prefix that qualifies the attribute name. It does not matter what value is assigned to this string because the Windows Media Services SDK implementation of the XML DOM does not fully support namespaces.

Return Values

Returns the attribute node removed, or NULL if no node was removed.

Remarks

This method is an extension of the World Wide Web Consortium (W3C) Document Object Model (DOM).

Example Code

The following example uses the removeQualifiedItem method to remove the attribute node named "src" from the specified element node.

using Microsoft.WindowsMediaServices.Interop;
using interop_msxml;

// Declare variables.
WMSServer Server;
IXMLDOMDocument Playlist;
IXMLDOMNamedNodeMap oNamedNodeMap;
IXMLDOMNodeList NodeList;
IXMLDOMAttribute nodeAtt;

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");

    // Remove an attribute named "src" from the first element
    // named "media".
    NodeList = Playlist.getElementsByTagName("media");
    oNamedNodeMap = NodeList[0].attributes;
    nodeAtt = (IXMLDOMAttribute)oNamedNodeMap.removeQualifiedItem("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