XML parsing in Applescript
Hi i am trying to parse a xml file and my getting the following error please can anyone help me
Can’t make «class xmld» {"<?xml version=\"1.0\"?><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=\"Dehli\"/><postal_code data=\"Dehli\"/><latitude_e6 data=\"\"/><longitude_e6 data=\"\"/><forecast_date data=\"2011-10-14\"/><current_date_time data=\"1970-01-01 00:00:00 +0000\"/><unit_system data=\"US\"/></forecast_information><current_conditions><condition data=\"Haze\"/><temp_f data=\"84\"/><temp_c data=\"29\"/><humidity data=\"Humidity: 37%\"/><icon data=\"/ig/images/weather/haze.gif\"/><wind_condition data=\"Wind: NW at 9 mph\"/></current_conditions><forecast_conditions><day_of_week data=\"Fri\"/><low data=\"70\"/><high data=\"93\"/><icon data=\"/ig/images/weather/mostly_sunny.gif\"/><condition data=\"Mostly Sunny\"/></forecast_conditions><forecast_conditions><day_of_week data=\"Sat\"/><low data=\"68\"/><high data=\"93\"/><icon data=\"/ig/images/weather/sunny.gif\"/><condition data=\"Clear\"/></forecast_conditions><forecast_conditions><day_of_week data=\"Sun\"/><low data=\"66\"/><high data=\"91\"/><icon data=\"/ig/images/weather/sunny.gif\"/><condition data=\"Clear\"/></forecast_conditions><forecast_conditions><day_of_week data=\"Mon\"/><low data=\"66\"/><high data=\"91\"/><icon data=\"/ig/images/weather/sunny.gif\"/><condition data=\"Clear\"/></forecast_conditions></weather></xml_api_reply>"} of application "System Events" into type XML data.
and the code my trying to implement is
set weatherquery to " /usr/bin/curl 'http://www.google.com/ig/api?weather=Dehli'"
tell application "System Events"
set xmltext to do shell scriptweatherqueryasstring
set file1 to XML data [xmltext] as XML data
end tell
It would be helpful if someone could help me with it.
MacBook Pro, Mac OS X (10.7.1)