3

I have implemented NSXMLParser in my app and I am reviewing alternatives. My complaints about NSXMLParser are that it's convoluted to implement for simple files, and it's not the zippiest thing around either.

So far I've identified:

Any others?

And what's your experience with these?

Thanks for your input!

John Fricker
  • 3,304
  • 21
  • 21

2 Answers2

5

We use libxml2 in our app, specifically the xmlTextReader API. It's a stream reader, which allows for much simpler code than a SAX reader (no callbacks, etc.) and doesn't put the whole document tree in memory like a DOM reader.

drewh
  • 10,077
  • 7
  • 34
  • 43
0

There is a very good example in the developer portal called XMLPerformance. It tells you how to parse xml files effectively using both libxml2 and NSXMLParser.

I am using it in one of my apps and the thing works great. I have some 600 items in my XML but the view hardly takes 1 sec to load using the methods provided in the example (without consuming much memory!)

lostInTransit
  • 70,519
  • 61
  • 198
  • 274
  • That's a good example, been there done that. But my intent is to discover additional XML libraries available. Thanks anyway! – John Fricker Mar 05 '09 at 04:58
  • Came across this on one of the posts - Jim Dovey's written his own xml parser (http://stackoverflow.com/questions/826281/better-performance-with-libxml2-or-nsxmlparser-on-the-iphone/842549#842549) – lostInTransit Jun 20 '09 at 11:42