<MyEvents>
<Tracking event="first">
<![CDATA[
http://www.myurl.com/test1
]]>
</Tracking>
<Tracking event="second">
<![CDATA[
http://www.myurl.com/test2
]]>
</Tracking>
<Tracking event="third">
<![CDATA[
http://www.myurl.com/test3
]]>
</Tracking>
<Tracking event="fourth">
<![CDATA[
http://www.myurl.com/test4
]]>
</Tracking>
<Tracking event="fifth">
<![CDATA[
http://www.myurl.com/test5
]]>
</Tracking>
</MyEvents>
I have this xml which i need to parse and store. As each node is named the same "Tracking" I dont know how to parse this xml. I want to parse and store urls corresponding with each event names(first, second, third, fourth and fifth in this case) in variables. I am using XMLPullParser and for other parts of this xml parsing was simple by making use of
if(myparser.getName().equalsIgnoreCase("tagname")){
//do something
}
in case of node with the same name but different event types i dont know how to parse. Any help is appreciated.
getAttributeValuemethod.