I have been meaning to download a number of XML parsers and stuff them all into an app to test out their performance along side TBXML. Fortunately, Ray Wenderlich has recently posted with an app that does exactly this!
He's put together a really good comparison of the different XML parsers available for the iPhone, listing their different features as well as performance comparisons.
It turns out that TBXML is the fastest parser out there. It's even faster libxml2! So if you need to parse a large XML document very quickly, TBXML is the one to choose!
However, libxml2 is a very capable XML parser with some more advanced features than what TBXML is able to offer. It's very important to choose an XML parser based on the requirements of the app your writing.
With TBXML Pro, I will try to add in some of these features while retaining, or increasing the speed at which TBXML runs.
Watch this space...
Saturday, 6 March 2010
Subscribe to:
Post Comments (Atom)

A very nice xml parser. Easy to understand, quick implemented and very fast. But with v1.3 its not possible to parse an rss feed... i am waiting for the pro-version.
ReplyDeleteHi Marcel,
ReplyDeleteThanks for the great comments! I've just had a go parsing an RSS feed as this should work with TBXML 1.3. However, I ran into a problem where the returned string is not properly decoded.
The fix was to change all the occurrences of NSUTF8StringEncoding to NSASCIIStringEncoding.
Once this was done, I was able to parse the following feed without any issues.
http://www.appleinsider.com/rss/iphone_blog.rss
This is actually a bug so I will try and fix it ASAP.
Thanks
Hi Tom,
ReplyDeletedo you have a workaround? I have tried to parse a feed but TBXML gets no root-node...
Thanks in advice
Hi Marcel,
ReplyDeleteTry changing all occurrences of NSUTF8StringEncoding to NSASCIIStringEncoding.
If you still have issues, send me the link and I'll try and figure out what's going wrong.
Thanks
Hi Tom,
ReplyDeletesorry. It won't work.
--snip
TBXML *xml = [[TBXML alloc] initWithURL:[NSURL URLWithString:XML_URL]];
TBXMLElement *rootXMLElement = xml.rootXMLElement;
if(rootXMLElement) {
I cant get the root XML Element....
I use the same feed as you. (appleinsider.com)
Hi Marcel,
ReplyDeleteIf you'd like to email me your project, I'll take a look and try and work out whats going wrong. Otherwise, If you'd like to drop me an email, I'll send you the updated TBXML files I'm using in my project.
You can email me at tom@tbxml.co.uk
Thanks
Hi Tom,
ReplyDeleteyou have mail...
Hi,
ReplyDeleteTBXML deals with namespace? ie.
Hi Tom,
ReplyDeleteyou say TBXML is the fastest parser out there. See: http://blog.metaobject.com/2010/05/xml-performance-revisited.html
MAX appears to be around 2x faster.
Marcel (different Marcel)
Hi Marcel (different Marcel)
ReplyDeleteThanks for the link! That's some really impressive timings!! I'll check it out properly real soon.
Cheers
love TBXML...so easy and fast (thats what she said, lol). Thanks for all your hard work!
ReplyDeleteT-West
hi
ReplyDeletehiii
hiiii
I am having an XML response like this,
How will be the dictionary o/p when I use dictionaryWithObjectsAndKeys?
m:properties = { d:pro1 = hi, d:pro1 = hiii, d:pro2 = hiiii}
or just
properties = { pro1 = hi, pro1 = hiii, pro2 = hiiii}
Please help me witha fast reply