Traversing complex xml File in android

2019-03-05 06:03发布

问题:

I have a xml file that is on this link

http://nchc.dl.sourceforge.net/project/trialxml/options.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.

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

回答1:

Try using DOM parser, to parse your xml document

See this link for further details:

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