Reputation: 6949
I would like to know some libraries in objective-C for xml parsing. I think it is a very common need, but I found limited resources for handling this task:
What is your best solution to work with XML in objective-C language? Please advice.
What is the solution that you have used for your product?
Upvotes: 2
Views: 1054
Reputation: 253
NSXMLParser is a stream-oriented class; you set it up and get delegate callbacks when it detects something. Usually this is not what you want to do, but can be much faster and lower memory.
TouchXML will parse the XML itself using libxml, and create an object tree for the entire XML structure. This allows you to easily access the contents of the XML tree, using manual traversal methods or basic XPaths (more sophisticated XPath support is planned).
Upvotes: 2
Reputation: 4866
It serves a narrow purpose, but if your goal is to parse untidy HTML, you might want to try a static library I started called TagScraper. It doesn't handle many/most XML/HTML entities correctly, but it could be pretty easily patched to. URL: http://github.com/searls/TagScraper
Its value is that it provides a simple XPath mechanism that hides the tidying/querying/assembling for you, and then it provides the parsed elements & attributes in a tree-like data structure of Tag.h
nodes.
Upvotes: 0