Practical XML Parsing

I presented “Practical XML Parsing” at the September 10, 2009 meeting of Seattle Xcoders. While there is still a touch of the initially intended distaste for parsing XML with DOM, it evolved into more of an overview and brief introduction of NSXMLDocument and NSXMLParser.

After cleaning out large copyrighted material (part of a Justin Timberlake song on the title screen and a Star Wars snippet on the XQuery screen) and removing many of the Keynote build animations I like to use but which translate poorly to static images, I have made the presentation available. I didn’t record the audio, so the text may seem more terse than it really was.

  • HTML export with most of the animations still intact
  • Zipped archive containing:
    • Keynote 09 file
    • PDF export
    • XMLDemo source serving as the examples I showed
  • You may want to look at vtd-xml as the state of the art in XML processing, consuming far less memory than DOM

    vtd-xml
  • If you have distaste for DOM, but would like something more convenient than SAX, you might want to check out Objective-XML. Features:

    - True incremental parsing
    - Something better than DOM or SAX
    - NSXMLParser-compatible SAX parser, if you want that
    - HTML parsing
    - Much faster than the built-in stuff ( roughly 10x )

    http://www.metaobject.com/blog/2009/01/objectiv...
  • You might want to take a look at vtd-xml, the next generation parser that claims to be a lot faster than DOM
  • @anon_anon:

    Interesting. My projects tend to use XML as an interchange format, focusing on the consumption and not the generation and putting the data into a SQL database or Core Data--hence the "Parsing" in the title and the short shrift on XSLT and XQuery in the presentation. I intentionally left out additional toolkits because I wanted to focus on the fundamentals and what's available by default in Apple's SDKs.

    I hadn't heard of vtd-xml before--looks like it might be an interesting addition to people's XML toolkit.
  • Nice, very nice ! Thanks !
  • Thx for sharing! Appreciated!
blog comments powered by Disqus