在android中遍历复杂的xml文件

Traversing complex xml File in android(在android中遍历复杂的xml文件)
本文介绍了在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文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

How to send data to COM PORT using JAVA?(如何使用 JAVA 向 COM PORT 发送数据?)
How to make a report page direction to change to quot;rtlquot;?(如何使报表页面方向更改为“rtl?)
Use cyrillic .properties file in eclipse project(在 Eclipse 项目中使用西里尔文 .properties 文件)
Is there any way to detect an RTL language in Java?(有没有办法在 Java 中检测 RTL 语言?)
How to load resource bundle messages from DB in Java?(如何在 Java 中从 DB 加载资源包消息?)
How do I change the default locale settings in Java to make them consistent?(如何更改 Java 中的默认语言环境设置以使其保持一致?)