Last year I mentioned a tutorial showing how to perform basic XML parsing using libxml and Hpple.
Here’s a library inspired by Nokogiri and JQuery from Francis Chong that makes it easier to parse XML and HTML on the iOS platform called IGHTMLQuery.
IGHTMLquery supports XPath searching, and you can chain commands just like with JQuery. IGHTMLQuery uses libxml behind the scenes.
Here’s an example from the readme demonstrating querying with IGHTMLQuery in Objective-C:
NSString* title = [[[node queryWithXPath:@"//cd/title"] firstObject] text];
[[node queryWithXPath:@"//title"] enumerateNodesUsingBlock:^(IGXMLNode *title, NSUInteger idx, BOOL *stop) {
NSLog(@"title = %@", title.text);
}];
// quick manipulation
[[node queryWithXPath:@"//title"] appendWithXMLString:@"Hi!"];
You can find IGHTMLQuery on Github here.
A handy library for parsing XML/HTML.
- Tutorial: Parsing HTML On With The Objective-C LibXML Wrapper Hpple
- Tutorial: Fetching And Parsing JSON And XML With Simple Reusable Classes
- Objective-C UIControl Category Inspired By JQuery Adding Many Blocks-Based Events
- (Cordova) Phonegap Compass Example Using jQuery Mobile
- Open Source: Easy Image Gallery With HTML/CSS Complete With Swipe Support
Original article: Open Source iOS Library Inspired By Nokogiri and JQuery For Easier XML/HTML Parsing
©2013 iOS App Dev Libraries, Controls, Tutorials, Examples and Tools. All Rights Reserved.




