Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

DaveP

macrumors 6502a
Original poster
Mar 18, 2005
506
433
Hey Everybody,
I would consider myself a pretty competent programmer, but I have little to none web-type experience, including XML. For my Cocoa project I want to be able to output and intput values to and from a file respectively, using XML. When I don't know how to do something it's usually just a case of reading a web page or two to figure it out. But there is information overload regarding XML, and most of the information is not very useful.

So a few questions...First off I quickly discovered there are a few ways in Cocoa to handle XML, the most current seems to be the NSXML classes (correct me if I'm wrong). Is this the way to go? Secondly, are there any good sites that will help me out. And finally, feel free to make any other suggestions that might help.

Thanks,
Dave
 

stoid

macrumors 601
I started a class this fall learning XML/CSS/XSL/DTD/etc. and our main textbook is the XML Bible 1.1, 3rd Edition by Elliotte Harold. I have found it to be an excellent introduction to XML related technologies. Too bad I can't find a good XML/XSL/DTD manipulator for the Mac.
 

GeeYouEye

macrumors 68000
Dec 9, 2001
1,669
10
State of Denial
Yes, just use NSXMLParser for reading. A bit of a learning curve, but very useful. For writing, I haven't done anything with XML in Tiger, but as of Panther, I think you needed to create the string/data to write out to the file using -writeToFile:.

BTW, I've heard that PyObjC is much, much better for XML work than straight Cocoa. YMMV, of course.
 

DaveP

macrumors 6502a
Original poster
Mar 18, 2005
506
433
kainjow said:
If you're planning on using your app only for Tiger, then use NSXML, but if you need compatibility with 10.3 or 10.2, you need to use something else, like this: http://iharder.sourceforge.net/macosx/xmltree/ which works great.

Does this work with Tiger? The download app says for Jaguar only and I cannot build and run on my system (which has Tiger). Hopefully it does because I'm looking for somethign that will work with 10.4 and 10.3.

Thanks
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.