Noob question in regards to NSXMLParser
Noob question in regards to NSXMLParser
- Subject: Noob question in regards to NSXMLParser
- From: "Eric E. Dolecki" <email@hidden>
- Date: Tue, 07 Jun 2011 10:03:22 -0400
I am fetching some XML weather from Google:
<xml_api_reply version="1">
<weather module_id="0" tab_id="0" mobile_row="0" mobile_zipped="1" row="0"
section="0">
<forecast_information>
<city data="Framingham, MA"/>
<postal_code data="01701"/>
<latitude_e6 data=""/>
<longitude_e6 data=""/>
<forecast_date data="2011-06-07"/>
<current_date_time data="2011-06-07 12:38:31 +0000"/>
<unit_system data="US"/>
</forecast_information>
<current_conditions>
<condition data="Sunny"/>
<temp_f data="69"/>
<temp_c data="21"/>
<humidity data="Humidity: 66%"/>
<icon data="/ig/images/weather/sunny.gif"/>
<wind_condition data="Wind: NW at 3 mph"/>
</current_conditions>
<forecast_conditions>
<day_of_week data="Tue"/>
...
What I am really after is the current_conditions data. How can one specify
WHERE in the XML to use the attributes from? A lot of the information is
repeated in other nodes so I can't just check (if([elementName
isEqualToString:@"condition"]){) , how can I check if the current element is
within a specific tag? (In this case the parent is current_conditions)?
Eric
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden