Reputation: 316
I am trying to parse a url that contains a xml file. I have tried many methods but I cannot get my head around it. Here is the xml file:
<xml>
<jobs>
<id>6</id>
<type>0</type>
<user_id>9</user_id>
<name>Steve Jobs</name>
<profilepic>
http://upload.wikimedia.org/wikipedia/commons/thumb/b/b9/Steve_Jobs_Headshot_2010- CROP.jpg/1024px-Steve_Jobs_Headshot_2010-CROP.jpg
</profilepic>
<bg>
http://9to5mac.files.wordpress.com/2014/08/yosemite-4.jpg
</bg>
<em>1</em>
<facebook>stevejobs</facebook>
<twitter>LegendSteveJobs</twitter>
<phone/>
<email/>
</jobs>
</xml>
It would be best if I could extract all of these into an array with the format of "type:data"
. Thanks for your help.
Upvotes: 2
Views: 231
Reputation: 104
You can use any one from the following:- 1) DOM Parser 2) Xml Pull Parser 3) Sax Parser.
You can use this link to parse a Xml. (http://www.androidhive.info/2011/11/android-xml-parsing-tutorial/)
Upvotes: 1