Displaying XML file in app

Discussion in 'Mac Programming' started by jashsayani, Feb 7, 2009.

  1. jashsayani
    Expand Collapse
    macrumors regular

    jashsayani

    Joined:
    Feb 7, 2009
    Location:
    San Jose, CA
    #1
    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 ?
     
  2. pstoehr
    Expand Collapse
    macrumors member

    Joined:
    Aug 5, 2003
    Location:
    Scheßlitz, Oberfranken, Bavaria, Germany
    #2
    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
     
  3. jashsayani
    Expand Collapse
    thread starter macrumors regular

    jashsayani

    Joined:
    Feb 7, 2009
    Location:
    San Jose, CA
    #3
    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.
     
  4. eddietr
    Expand Collapse
    macrumors 6502a

    Joined:
    Oct 29, 2006
    Location:
    Virginia
    #4
    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)
     
  5. jashsayani
    Expand Collapse
    thread starter macrumors regular

    jashsayani

    Joined:
    Feb 7, 2009
    Location:
    San Jose, CA
    #5
    Thanks man, that helped.

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

    Thanks.
     

Share This Page