name Property (IXMLDOMAttribute)
Contains the attribute name.
[Script]
Script Syntax
strValue = oXMLDOMAttribute.name;
Example
The following script example creates an IXMLDOMAttribute object from the first attribute of the root, and then displays the value of its name.
var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.4.0");
var root;
var objDOMatt;
xmlDoc.async = false;
xmlDoc.load("books.xml");
root = xmlDoc.documentElement;
objDOMatt = root.firstChild.attributes.item(0);
alert(objDOMatt.name);
[Visual Basic]
Visual Basic Syntax
strValue = oXMLDOMAttribute.name
Example
The following Microsoft® Visual Basic® example creates an IXMLDOMAttribute object from the first attribute of the root, and then displays the value of its name.
Dim xmlDoc As New Msxml2.DOMDocument40
Dim root As IXMLDOMElement
Dim objDOMatt As IXMLDOMAttribute
xmlDoc.async = False
xmlDoc.Load ("books.xml")
Set root = xmlDoc.documentElement
Set objDOMatt = root.firstChild.Attributes.Item(0)
MsgBox objDOMatt.Name
[C/C++]
C/C++ Syntax
HRESULT get_name(
BSTR *attributeName);
Parameters
- attributeName [out, retval]
- Name of the attribute. The value is the same as the nodeName property of the IXMLDOMNode object.
C/C++ Return Values
- S_OK
- Value returned if successful.
- S_FALSE
- Value when returning Null.
- E_INVALIDARG
- Value returned if attributeName is Null.
Remarks
String. The property is read-only. It returns the name of the attribute. The value is the same as the nodeName property of the IXMLDOMNode.
To view reference information for Visual Basic, C/C++, or Script only, click the Language Filter button
in the upper-left corner of the page.
See Also
nodeName Property | IXMLDOMNode
Applies to: IXMLDOMAttribute