
Untitled
By: a guest on
May 10th, 2012 | syntax:
None | size: 0.76 KB | hits: 29 | expires: Never
Having troubles with CXMLDocument parser in iOS
CXMLDocument *parser = [[[CXMLDocument alloc] initWithContentsOfURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://free.worldweatheronline.com/feed/weather.ashx?q=%@&includeLocation=yes&format=xml&cc=no&date=2012-01-02&key=8adf0ef591225819113001", query]] options:0 error:nil] autorelease];
lowTemp = [[[[[parser nodesForXPath:@"/data/weather/tempMinF" error:nil] objectAtIndex:0] attributeForName:@"data"] stringValue] integerValue];
<data>
<weather>
<tempMinF>4</tempMinF>
</weather>
</data>
<xml_api_reply version="1">
<weather module_id="0" tab_id="0" mobile_row="0" mobile_zipped="1" row="0" section="0">
<current_conditions>
<temp_f data="52"/>
</current_conditions>
</weather>
</xml_api_reply>