iPhone XML Parser Help - Unique

Discussion in 'iPhone/iPad Programming' started by XcodeNewb, Feb 6, 2009.

  1. macrumors member

    Joined:
    Feb 6, 2009
    #1
    Ok, I know there are a lot of parser examples and I have been through them all. I thought I had it figured out until I realized that some of the data I need is actually in the tag of one of the elements.

    Here is an example. I need the price read in here but also the url link. I am using the simple xml process with the didStartElement, didEndElement and the foundCharacters methods. These methods find the price tag and read the data ( i.e. 250 ) but I cannot get the url from this tag. Any ideas?

    Thanks in advance. I am learning as I go. I hope the code displays correctly.

    Code:
      <trips>
        <trip>
          <price url="/bookmeToday/code=0-ICtL5lnamzyrp29sDFqq.sJJWXUydEzy5W1k_q2v7.3-5iP1kAlP_y6jYWhQXUR.F.UA.25770.0&_sid_=3-5iP1kAlP_y6jYWhQXUR" currency="USD">$250</price>
          <more>More data here</more>
          <evenmore>Even more data</evenmore>
        </trip>
      </trips>
     
  2. macrumors regular

    Joined:
    Jun 10, 2008
    #2
  3. thread starter macrumors member

    Joined:
    Feb 6, 2009
    #3
    Great answer

    Thanks kalimba. I will try this out this afternoon and let you know how it goes. Thanks for taking the time to help.
     
  4. thread starter macrumors member

    Joined:
    Feb 6, 2009
    #4
    Great

    Thanks again kalimba. Example worked great and took about 30 seconds to do. Thanks again
     

Share This Page