I’m new to xml. I’d like to get all the element name from a xml file with xml dom parser, for example the xml file is,
(element’s name is dynamic)
<aaa>
<bbb>
<id/>
<name/>
<bbb>
<bbb>
<id/>
<name/>
<bbb>
<ccc>
<time/>
<date/>
</ccc>
....
</aaa>
and I want to create a list like this;
aaa,bbb,id,name,ccc,time,date
How can I do it?
You could use one of the popular APIs such as JDOM or Xom.
The Xom tutorial has an example that does something very similar to what you want.
http://www.xom.nu/tutorial.xhtml#Navigator