Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

computerartist

macrumors newbie
Original poster
Sep 4, 2010
28
0
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>


???
 
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
 
You might want to step back and read a little more about xml, objective c, and NSXMLParser. You can display the information however you want.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.