8/8/2010 11:06:22 PM
Title:
Get attributes of XML
I have an XML like the following.
Alerts
<alerts>
<alert id="123" issued="2010-03-01
21:08:44.117" expires="2010-10-10">
<msg>This is a message.</msg>
</alert>
</alerts>
I want to get the atttributes of the alert tag.
How to get it please help.
8/9/2010 2:21:06 AM
use attributes property to acess the xml attributes and pass the position , I passed 0 to access the first attribute id. xml1 is your xml.
xml1.alert.attributes()[0]