I have to parse relatively huge amount of XML data, thus I am going for TBXMLParser
. And I am pretty new to it. Below is the sample XML format.
<item>
<title> Test XML</title>
<link>http://www.google.com</link>
<media:content url="http://blog.directorymaximizer.com/wp-content/uploads/2012/09/google.jpg" medium="image">
<media:title type="html”>Google</media:title>
</media:content>
<media:content url="http://icons.iconarchive.com/icons/fasticon/web-2/256/Google-icon.png" medium="image">
<media:title type="html”>Google-Png</media:title>
</media:content>
<media:content url="http://icons.iconarchive.com/icons/fasticon/web-2/256/Google-icon.png" medium="image">
<media:title type="html”>Google-Png</media:title>
</media:content>
</item>
and it goes on...
I want to get the value of second url =‘Have to...’.
TBXMLElement *iconElement = [TBXML childElementNamed:@"Image" parentElement:element];
strIcon = [TBXML valueOfAttributeNamed:@"url" forElement:iconElement];
This is the code, I tried. Using this, I was able to get the first url
attribute value. Any suggestions would be highly appreciated. Thank you :)