How to parse XML in Android [closed]

2019-01-12 13:04发布

I need to parse to following xml into output like :

   String id="3" 
   String name="str1"
   String path="/mnt/sdcard/path2"
   String type="2"
   String desc="des3)"

How can I accomplish this in android? Thanks.

<xmldump>
  <mfs id="3" name="str1" path="/mnt/sdcard/path2" type="2" desc="des3)" />
  <mfs id="1" name="st2" path="/mnt/sdcard/path1" type="2" desc="des2" />
  <mfs id="2" name="stvr3" path="/mnt/sdcard/path3" type="2" desc="des1" />
</xmldump>

4条回答
Summer. ? 凉城
2楼-- · 2019-01-12 13:23
疯言疯语
3楼-- · 2019-01-12 13:29

i think this will help you a lot. It also helps me a lot too..Give it a try! http://www.coderzheaven.com/2011/12/24/parsing-xml-in-android-a-simple-example/

查看更多
beautiful°
5楼-- · 2019-01-12 13:45
登录 后发表回答