views:

722

answers:

8

Hi all,

I am going to develop an application which will parse the RSS feeds and display the items in my custom cell.(Cell containing the image, label, description, etc). The most popular way of parsing is using the NSXMLParser. But this is bit of a lengthy way. So is there any other way to do this. Or my question will be, which is the best xml parser for objective-c ?

+1  A: 

Ask Google. You will find TouchXML and KissXML. The best Cocoa XML parser is NSXMLDocument, but this is only available currently in MacOS X.

Paul Lynch
Thanks for the suggestion Paull :), I am doing it .......
Ansari
A: 

Well,

I have googled it a lot, and came across many solutions which vary from situation to situation.

NSXMLParser, its a SAX parser, so it only traverse and do not store the data. It is very slow as well. TouchXML, its a DOM parser, and so it stores the data after parsing, searching of any node so much easier. And its faster as well. But in case of very large XML documents, its not a recommended solution. KissXML, Its based on TouchXML although it goes further. TouchXML allows you to read XML, while KissXML allows you to both read and write XML.

As in my case i do need to write the xml, but i need to keep the xml data and use frequently on various spots in app. So i am going to use TouchXML.

For more information, i found some links also,

http://www.71squared.com/2009/05/processing-xml-on-the-iphone/

http://www.cocoaism.com/tag/touchxml/

Ansari
They are all based on libxml2; I like DOM solutions because they are typically simpler to use. TouchXML I believe is slower than NSXMLParser. You might also be interested in:http://cocoawithlove.com/2008/10/using-libxml2-for-parsing-and-xpath.html
Paul Lynch
A: 

If you want an easy way to get to the RSS feed data, then you may want to consider using the XML data binding approach. In a nutshell, instead of "raw" XML elements, attributes, and text you will get objects that will contain all the information parsed and presented in a natural form (i.e., a number as int, not string). I haven't heard of such a tool for Objective-C specifically, but there are a number of C as well as C++ ones, which can be used from Obj-C. The C++ version will probably be more convenient to use since the language has direct support fo OOP.

One such tool for C++ (which is also fairly compact with no additional dependencies) is XSD/e. In particular, it has been used in quite a few iPhone applications:

http://www.codesynthesis.com/products/xsde/

Boris Kolpackov
+1  A: 

I just found a page, This can tell better about choosing the best parser ..... How To Choose The Best XML Parser for Your iPhone Project

Ansari
A: 

I've released an open source RSS/Atom Parser for iPhone and hopefully it might be of some use. It makes reading and parsing web feeds extremely easy.

There's a simple demo app too which shows how easy it is to implement. Hope this helps!

Michael Waterfall
A: 

Have you tried WonderXML: http://wonderxml.googlecode.com/

Luke Du
A: 

I'm doing some development for Mac OSX and for xml parsing I'm using TBXML which is a lightweight library.

My reasons for using it? Very simple to use, very easy, very clean. I found the documentation for NSXMLDocument and NSXMLParser to be too cumbersome and lengthy for me and seemed to over-complicate things for what I needed.

djhworld
A: 

Hi! IM trying to do the same thing as you, but can't get the images to load, Did you figure out how to do it? I would love to know, im really struggeling with this... Thanks!

see my post down... I have already accomplished my goals using the TouchXml the DOM Parsing solution.
Ansari