Q:

XML applescript

I know there are loads of threads with titles like this but I'm new to applescript and I don't understand them. Basically I want to take this XML http://api.openweathermap.org/data/2.5/weather?q=NewYork&mode=xml
and then put the values like temperature and wind speed into their own variable so I can do what ever I want with them. 
Is this possible? 
Thanks

A:

You really should post the code you have so far, otherwise it looks like you know no coding and are just asking someone to do work for you.
You have two choices. One is to use one of a few XML parsing options. But for some applications of small XML files like you have on the openweathermap site, is to just hard code the delimiters to pull what you want. This works for what you've asked:
set xmlString to do shell script "curl 'http://api.openweathermap.org/data/2.5/weather?q=NewYork&mode=xml'"

set otid to AppleScript's text item delimiters

set AppleScript's text item delimiters to "<temperature value=\""
set xmlString to text item 2 of xmlString
set theTemp to word 1 of xmlString

set AppleScript's text item delimiters to "<speed value=\""
set xmlString to text item 2 of xmlString
set AppleScript's text item delimiters to "\""
set theSpeed to text item 1 of xmlString

set AppleScript's text item delimiters to otid

return "Temperature is " & theTemp & " & Speed is " & theSpeed

