2

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.

11
  • u can use xml parser in android Commented Aug 23, 2014 at 20:20
  • 1
    refer this developer.android.com/training/basics/network-ops/xml.html Commented Aug 23, 2014 at 20:23
  • @DIVA can you give me an example please ? Commented Aug 23, 2014 at 20:23
  • yes but i can give example of how to parse xml with showing my xml? Commented Aug 23, 2014 at 20:26
  • I need to get all the fields in my xml... I don't know but please do Commented Aug 23, 2014 at 20:27

1 Answer 1

1

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/)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.