MultiLevel Parsing using DOM parser – TouchXML

Hello Everyone ! Using this post I am going to describe the most complicated parsing of complex XML data using TouchXML parsing method.

Let’s have a brief idea. Say for example, if you have to parse following xml file. It’s a sample Flickr API response.

URL used to fetch this data is  as follows.

TouchXML for Flickr API

TouchXML for Flickr API

Sample Data Response.

Observe above complex XML ( It is one of the FLICKER API )

You can notice that XML is having Multi-level data. Feed/Entry/Author. Also, most of the tags are having attributes.

Some tages are repeated, for example link tag is repeated under entry tag. So, how are you going to parse them.

Assume that You have to parse & grab all the data. This is just one of the API, there are lot more. You can to write specific code for each different XML responses. It is preferable to generate a re-usable code. I have implemented such a code which can help to parse any kind of XML.

 

Here is the console/NSLog output of parsed dictionary.

Grab the sample code from here.

7 thoughts on “MultiLevel Parsing using DOM parser – TouchXML

  1. Hello there, You’ve done a fantastic job. I’ll certainly digg it and for my part recommend to my friends. I’m confident they will be benefited from this website.

    • Thanks for the visiting our knowledge sharing block (iDev Tricks)
      Also you can send me mail if you want to share your knowledge over our site then contact us and freely you can also share your knowledge over this site.

      Thanks and Regards,
      Neon Samuel.

  2. It’s in fact a nice and helpful piece of info. I am happy that you simply shared this helpful information around.

    Please stay us updated this way. Thanks for sharing.

Leave a Reply

Your email address will not be published. Required fields are marked *



*