Objective-C DOM XML parser for iPhone
If you want to use libxml2
with an Objective-C front without SAX events, take a look at this useful set of wrapper functions.
You issue an XPath query to your XML document object and get back Foundation class objects: NSArray
, NSString
, and NSDictionary
, e.g.:
NSArray *queriedBuckets = PerformXMLXPathQuery(responseData, @"//*[local-name()='Buckets']/*[local-name()='Bucket']");
These functions help merge the speed of libxml2
with the readability and usability of Objective-C code.
I suggest looking at the Google Data API for Objective-C (iPhone) at http://code.google.com/p/gdata-objectivec-client/
In particular, look at these files which define the GDataXMLNode class:
http://gdata-objectivec-client.googlecode.com/svn/trunk/Source/XMLSupport/