在android中遍历复杂的xml文件 [英] Traversing complex xml File in android

查看:19
本文介绍了在android中遍历复杂的xml文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这个链接上有一个 xml 文件

I have a xml file that is on this link

http://nchc.dl.sourceforge.net/project/trialxml/options.xml

我已经成功下载并解析了它,还做了一个动态 UI,但我没有使用任何预定义的函数,如 getFirstChild()getNextSibling()使我的解析器无法解析具有大约 6-7 级菜单的复杂 XML 文件.

I have downloaded and parsed it successfully and also made a dynamic UI, but I have not used any of the predefined functions like getFirstChild(), getNextSibling() which makes my parser incompatible of parsing complex XML files having around 6-7 levels of menus.

请帮助如何遍历XML文件,并动态创建UI.

Please help how to traverse a XML file,and dynamically create a UI.

推荐答案

尝试使用 DOM parser,解析你的 xml 文档

Try using DOM parser, to parse your xml document

查看此链接了解更多详情:

http://tutorials.jenkov.com/java-xml/dom.html

这篇关于在android中遍历复杂的xml文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆