Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The getNamedItem method retrieves the attribute with the specified name.
IXMLDOMNode = IXMLDOMNamedNodeMap.getNamedItem(
string strName
);
Arguments
strName |
[in] string specifying the name of the attribute. |
Return Value
Returns an IXMLDOMNodeIXMLDOMNode Object (C#) for the specified attribute. The method returns NULL if the attribute node is not in this collection.
Example
The following example uses the getNamedItem method to retrieve an attribute named "src".
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;
// Retrieve an attribute named "src".
XMLNode = XMLNamedNodeMap.getNamedItem("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
Reference
IXMLDOMNamedNodeMap Object (C#)