September 5th, 2010, 12:23 AM
-
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>
???
September 7th, 2010, 08:43 AM
-
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
October 13th, 2010, 02:25 AM
-
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