Parsing XML data like this! Please help

Discussion in 'iOS Programming' started by MynEz, Mar 17, 2011.

  1. MynEz macrumors newbie

    Joined:
    Jan 13, 2011
    Location:
    Regina,Sask
    #1
    Hi, I need to parse the XML data like this, I don't know how can I parse this data. Actually It is the plist data. I need to load or parse this data (plist's file) from url. If somebody knows how to do this please help me.


    Thank you

    Code:
    <dict>
        <key>Rows</key>
        <array>
          <dict>
            <key>Title</key>
            <string>#TEXT TEXT TEXT</string>
            <key>Children</key>
            <array>
              <dict>
                <key>Title</key>
                <string>#TEXT-ROW1</string>
                <key>Children</key>
                <array>
                  <dict>
                    <key>Title</key>
                    <string>#TEXT-ROW2</string>
                    <key>Children</key>
                    <array>
                      <dict>
                        <key>Title</key>
                        <string>TEXT TEXT TEXT TEXT</string>
                      </dict>
    
     
  2. (marc) macrumors 6502a

    (marc)

    Joined:
    Sep 15, 2010
    Location:
    the woods
    #2
    What you're looking for is an XML parser. Take a look here for a comparison of XML parsers running on iOS.
     
  3. MynEz thread starter macrumors newbie

    Joined:
    Jan 13, 2011
    Location:
    Regina,Sask
  4. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #4
    A plist that has been written from iOS or MacOS X can be read on those OSes using [NSDictionary dictionaryWithContentsOfFile] or the similar method in NSArray. You don't have to explicitly parse the XML.
     
  5. balamw Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #5
    Plus, it seems like that parser is somewhat optimized over the generic NSXMLParser according to the comments here:

    http://www.cocoabuilder.com/archive...ionary-against-nsxmlnode-and-nsxmlparser.html

    B
     

Share This Page