Helpful Information
 
 
Category: iPhone SDK Development
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:




<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:


<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

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










privacy (GDPR)