rentzsch.com: tales from the red shed

Excelsior: ObjC XML

Rock
Last year I wrote an ObjC Cocoa app that needed to slurp XML files into an in-memory tree. Jim Rankin's fantastic Excelsior open source framework made tree slurping one line of code:

XMLKeyValueElement *tree = [XMLKeyValueElement elementWithDataFromURL:[NSURL fileURLWithPath:[@"~/data.xml" stringByExpandingTildeInPath]]];

Exactly the way it should be. Jim's framework provides a bunch of additional features like instance marshaling, but I only needed to slurp up the tree and walk it. Oh, it supports a KVC-style element key paths (but, sadly not XPath which would be a lot more work).

Wednesday, April 14, 2004
04:44 PM