Share via


IXMLDOMAttribute.name (C#)

banner art

Previous Next

IXMLDOMAttribute.name (C#)

The name property contains the attribute name.

Syntax

  string = IXMLDOMAttribute.name;

Remarks

The property is read-only. It returns the name of the attribute. The value is the same as the value of the nodeName property.

Example Code

The following example creates an IXMLDOMAttribute object from the first attribute of the root, and then displays its name.

using Microsoft.WindowsMediaServices.Interop;
using interop_msxml;

// Declare variables.
WMSServer Server;
IXMLDOMDocument Playlist;
IXMLDOMElement Root;
IXMLDOMAttribute objDOMatt;

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 the root element.
    Root = Playlist.documentElement;

    // Display the first attribute name of the first child.
    objDOMatt = (IXMLDOMAttribute)Root.firstChild.attributes[0];
    MessageBox.Show(objDOMatt.name.ToString());
}
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