I am parsing XML with DOM i have some data tags like:
<data>
<option>abc</option>
<option>ijk</option>
<option>fgh</option>
<option>njk</option>
<option>klj</option>
<option>opi</option>
</data>
<data>
<option>abc</option>
<option>ijk</option>
<option>fgh</option>
<option>njk</option>
<option>klj</option>
<option>opi</option>
</data>
I want to insert the options in the list in my layout how can I do the same pls tell. I want that it just parse data of first block and for the next it asks for the trigger event like by clickin on a button.
Thanx in advance.
Since you want to parse partial XML data, it would be better to use the
XmlPullParser.You would need to have a method that reads one block at a time keeping a reference to the parser as a member variable.
and call the
getDatamethod in the callback event (likeOnClickof the button). Remember to use the same instance of the object for getting the data.