XML:
<States>
<State ref="FL" const="27">
<name>Florida</name>
<capital>Tallahassee</capital>
</State>
<State ref="IA" const="29">
<name>Iowa</name>
<capital>Des Moines</capital>
</State>
</States>
Code (VBScript):
Set objXMLDoc = CreateObject("Microsoft.XMLDOM")
objXMLDoc.async = False
objXMLDoc.load("states.xml")
Set LastState = objXMLDoc.documentElement.lastChild
Set RefAttr = LastState.getAttributeNode("ref")
document.write("Name: " & RefAttr.name)
document.write("<br>Value: " & RefAttr.value)
Output:
Name: ref
Value: IA