PDA

View Full Version : Cocoa XML




DavidLeblond
Sep 21, 2004, 07:27 PM
I'm writing a small application in Objective-C that mimics a similar application I coded in Visual Basic years ago. I'd like it to read the same files, which are in XML. I've found a lot of different XML libraries to use with Cocoa, but what do you guys prefer/use?



iMeowbot
Sep 24, 2004, 09:53 AM
I'm lazy and just use property lists for that kind of thing. It's such a tiny DTD and the schema is basically built into the data, so it's easy to use them elsewhere.

CFXMLParser and CFXMLTreeCreateXMLData are also built into OS X if you need something more specialized, like duplicating that old layout. It doesn't have an ObjC wrapper, but IMO it doesn't especially need one.

DavidLeblond
Sep 24, 2004, 10:14 AM
I'm currently working with this:
http://developer.apple.com/documentation/Cocoa/Conceptual/XMLParsing/XMLParsing.html

So far so good, I'll let you know how it goes.

iMeowbot
Sep 24, 2004, 11:31 AM
Oo, the libxml wrapper. Now you're asking for trouble =) Good luck though!

DavidLeblond
Sep 28, 2004, 12:45 PM
Oo, the libxml wrapper. Now you're asking for trouble =) Good luck though!

Actually it turned out quite well. My implementation was a bit cludgey but as long as it works...

Not that I was using any sort of complicated schema or anything.