RE: A good method for xml usage/parsing
RE: A good method for xml usage/parsing
- Subject: RE: A good method for xml usage/parsing
- From: "Josh Ferguson" <email@hidden>
- Date: Fri, 24 Jan 2003 09:29:07 -0600
- Thread-topic: A good method for xml usage/parsing
Francisco,
Unfortunately, in my experience there really isn't anything built into cocoa. The program that I work on (FileStorm) stores its projects as XML files using an NSDictionary and the CoreFoundation function CFPropertyListCreateXMLData (using NSString's propertyList . This works great when all of your objects conform to NSCoding and as long as these files are meant to be read by Cocoa and Carbon applications (since they'll have the built in tools to interpret them).
I also recently worked on a small project that needed to read and write XML files that were going to be read/written by a .NET application on the Windows platform. Unfortunately, Apple's plist format for XML is somewhat restrictive, and certainly not always appropriate for all types of data. In this case, I used libxml (a C library). They have a pretty easy-to-follow tutorial at their site that will show you the basics of how to use the library (it's not complicated, but not real intuitive either). Before jumping into that, I recommend that you have a decent understanding of XML concepts (and vocabulary). Using libxml won't be as pretty as your typical cocoa code, but once you get past the initial learning curve I think you'll find that it's a more robust solution than the CoreFoundation offerings.
That's just my two cents.
Josh Ferguson
FileStorm Development
MindVision Software
www.mindvision.com/filestorm
-----Original Message-----
From: Francisco Tolmasky [
mailto:email@hidden]
Sent: Thursday, January 23, 2003 11:31 PM
To: Cocoa Development List
Subject: A good method for xml usage/parsing
Ok, I'm writing a program and I'd like to use xml as my file type.
Now, if I'm not mistaken archiving things does put them in some sort of
xml format correct? I'm not sure if this is enough though. I
basically want to store a database in xml format, what would you guys
suggest is the best method. I took a look at the core foundations
stuff and there must be an easier way. I also saw STXML, but with a
sophisticated system that complies to standard like cocoa, I would
think it would be built in no?
Any help is greatly appreciated. Thank you.
Francisco Tolmasky
email@hidden
http://users.adelphia.net/~ftolmasky
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.