I am using XmlPullParser in android to parse an XML file. Its work is great when there are no subtets in my xml, I just check the start tag with XmlPullParse.START_TAG and get the corresponding attribute value, but I'm stuck in the problem, here one tag has a different subtag and this sub has an attribute that contains a link to picture. I cannot extract this link from this subtag.
Here is my XML: -
<section name="section1"> <photo id="1" ilink="ImageLink 1"/> <photo id="2" ilink="ImageLink 2"/> </section> <section name="section2"> <photo id="3" ilink="ImageLink 1"/> <photo id="4" ilink="ImageLink 2"/> </section>
I get the parent tag, which is the โsectionโ and its attribute โnameโ, but how can I get the tag โphotoโ according to the name of the section? That is, if I want to analyze the photo library of a section called "section2", then how can I do this ??
Please help me figure this out. Any help would be noticeable.
Thanks in advance.
Salman khan
source share