#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2010
    Posts
    6
    Rep Power
    0

    IPhone SDK RSS Parser - Traversing XML


    I have used iPhone SDK parsers and am kind of familiar with the programming and the options.

    My question is how to traverse an XML file with the following structure:


    Code:
    <election name="Latest Election Polls">
        <poll date="Sat, 04 Sep 2010 15:36:44 -0500" pollster="Chicago Tribune" race="Illinois Governor - Brady vs. Quinn" year="2010" type="Governor" state="IL" poll_id="1361" spread="Brady +5.0">
            <candidate name="Brady" affiliation="Republican" value="37"/>
            <candidate name="Quinn" affiliation="Democrat" value="32"/>
        </poll>
    </election>

    ???
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2010
    Posts
    6
    Rep Power
    0
    for:

    Code:
    <election name="Latest Election Polls">
        <poll date="Sat, 04 Sep 2010 15:36:44 -0500" pollster="Chicago Tribune" race="Illinois Governor - Brady vs. Quinn" year="2010" type="Governor" state="IL" poll_id="1361" spread="Brady +5.0">
            <candidate name="Brady" affiliation="Republican" value="37"/>
            <candidate name="Quinn" affiliation="Democrat" value="32"/>
        </poll>
    </election>

    How do I display?:

    candidate >> name
    candidate >> affiliation
    candidate >> value
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2010
    Posts
    1
    Rep Power
    0
    NSXMLParser notifies it's delegate when the following occurs.
    parserDidStartElement:The method will pass in a dictionary object of attributes.I personally would setup an object and use KVC.

    _______________
    VLC Player Download

IMN logo majestic logo threadwatch logo seochat tools logo