首页 » Android » android xml解析

android xml解析

原文 http://blog.csdn.net/qq_36385296/article/details/79196756

2018-01-30 02:01:10阅读(582)

1,要解析的xml文件文件

xml="<apps>\n" +
                "  <app>\n" +
                "    <id>1</id>\n" +
                "    <name>burn</name>\n" +
                "    <version>1.0</version>\n" +
                "    <info>\n" +
                "      <size>10.5</size>\n" +
                "      <message>hhhhhhhh</message>\n" +
                "    </info>\n" +
                "    <info>\n" +
                "      <size>10.5</size>\n" +
                "      <message>hhhhhhhh</message>\n" +
                "    </info>\n" +
                "  </app>\n" +
                "  <app>\n" +
                "    <id>2</id>\n" +
                "    <name>burn2</name>\n" +
                "    <version>2.1</version>\n" +
                "    <info>\n" +
                "      <size>10.5</size>\n" +
                "      <message>hhhhhhhh</message>\n" +
                "    </info>\n" +
                "    <info>\n" +
                "      <size>10.5</size>\n" +
                "      <message>hhhhhhhh</message>\n" +
                "    </info>\n" +
                "  </app>\n" +
                "  <app>\n" +
                "    <id>3</id>\n" +
                "    <name>burn3</name>\n" +
                "    <version>3.2</version>\n" +
                "    <info>\n" +
                "      <size>10.5</size>\n" +
                "      <message>hhhhhhhh</message>\n" +
                "    </info>\n" +
                "    <info>\n" +
                "      <size>10.5</size>\n" +
                "      <message>hhhhhhhh</message>\n" +
                "    </info>\n" +
                "  </app>\n" +
                "</apps>";

2,使用pull方式解析xml文件

private void parseXmlWithPull() {

最新发布

CentOS专题

关于本站

5ibc.net旗下博客站精品博文小部分原创、大部分从互联网收集整理。尊重作者版权、传播精品博文,让更多编程爱好者知晓!

小提示

按 Ctrl+D 键,
把本文加入收藏夹