PDA

View Full Version : Displaying XML file in app




jashsayani
Feb 7, 2009, 07:43 AM
I want to make a Cocoa app that displays selected information from a Cocoa file.

For example, the XML file has the foll:
Key-Data1 (Value - 1)
Key-Data2 (Value - 2)
Key-Data3 (Value - 3)

I want it to read the file and display the value of the specified key.

How do I do it ?



pstoehr
Feb 7, 2009, 09:52 AM
Hi,

I would start with by looking at chapter 28 of Aarons book. Thats an example of using NSXMLDocument to parse information.

Best regards
Peter

jashsayani
Feb 7, 2009, 11:13 AM
Hi,

I would start with by looking at chapter 28 of Aarons book. Thats an example of using NSXMLDocument to parse information.

Best regards
Peter

Thanks. But I don't have that book and amazon is not available in my country.
Could you help me with the link to the Apple documentation or online examples. Thanks.

eddietr
Feb 7, 2009, 11:42 AM
In the Apple docs you could read Tree-Based XML Programming Guide for Cocoa.

(Or if you prefer/need a SAX style event driven model there is also Event-Driven XML Programming Guide for Cocoa)

jashsayani
Feb 9, 2009, 02:49 AM
In the Apple docs you could read Tree-Based XML Programming Guide for Cocoa.

(Or if you prefer/need a SAX style event driven model there is also Event-Driven XML Programming Guide for Cocoa)

Thanks man, that helped.

If possible, could you also post the link to the sample code on Apple site for XML reading app.

Thanks.