hello i am new in android i want know how to iterate child node from xml xml is as follow
<?xml version="1.0" encoding="utf-8"?> <ACT>
<Item>ABC</Item>
<Item>XYZ</Item> </ACT>
i want to take Item VAlue From ACT tag
hello i am new in android i want know how to iterate child node from xml xml is as follow
<?xml version="1.0" encoding="utf-8"?> <ACT>
<Item>ABC</Item>
<Item>XYZ</Item> </ACT>
i want to take Item VAlue From ACT tag
Take a look at this answer.
Update: the code posted will only list the first Item because the loop over nodes3
in onCreate
loops only over the ACT
elements. Since you have only one of these, the loop will iterate once, write out the first child and then terminate. You must have a second loop inside your loop where you iterate over all child nodes of element e
.
SAX parser is a great way to parse this kind of an xml file. Follow some SAXParsing tutorial.