Contains the attribute name.
strValue = oXMLDOMAttribute.name;
The following script example creates an IXMLDOMAttribute
object from an attribute of the first child of the root, and then displays the value of its name.
var xmlDoc = new ActiveXObject5.0("Msxml2.DOMDocument.5.0"); var root; var objDOMatt; xmlDoc.async = false; if (xmlDoc.parseError.errorCode <> 0) { var myErr = xmlDoc.parseError; alert("You have error " + myErr.reason); } else { xmlDoc.load("books.xml"); root = xmlDoc.documentElement; objDOMatt = root.firstChild.attributes.item(0); alert(objDOMatt.name); }
strValue = oXMLDOMAttribute.name
The following Microsoft® Visual Basic® example creates an IXMLDOMAttribute
object from an attribute of the first child of the root, and then displays the value of its name.
Dim xmlDoc As New Msxml2.DOMDocument50 Dim root As IXMLDOMElement Dim objDOMatt As IXMLDOMAttribute xmlDoc.async = False xmlDoc.Load ("books.xml") If (xmlDoc.parseError.errorCode <> 0) Then Dim myErr Set myErr = xmlDoc.parseError MsgBox("You have error " & myErr.reason) Else Set root = xmlDoc.documentElement Set objDOMatt = root.firstChild.Attributes.Item(0) MsgBox objDOMatt.Name End If
HRESULT get_name( BSTR *attributeName);
nodeName
property of the IXMLDOMNode
object.attributeName
parameter is Null.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.
nodeName Property | IXMLDOMNode
Applies to: IXMLDOMAttribute