Really annoying google latitude code, should work!

What am I doing wrong here? I expect a return from this with all the details I need!

try
	set rawdata to do shell script "curl 'http://www.google.com/latitude/apps/badge/api?user=" & myGoogleLatID & "&type=atom'"
	set mylocation to replaceText(space, ",", (first item of xml_parser(rawdata, "georss:point")))
	set myLongitude to first word of mylocation
	set myLatitude to last word of mylocation
	set rawdata to do shell script "curl 'http://maps.google.com/maps/geo?output=xml&key=abcdefg&q=" & mylocation & "'"
	set myZipcode to first item of xml_parser(rawdata, "PostalCodeNumber")
	set myCountry to first item of xml_parser(rawdata, "CountryName")
	set myState to first item of xml_parser(rawdata, "AdministrativeAreaName")
	set myTown to first item of xml_parser(rawdata, "LocalityName")
	set myStreet to first item of xml_parser(rawdata, "ThoroughfareName")
	set mylocation to {street:myStreet, city:myTown, state:myState, zipcode:myZipcode, country:myCountry, longitude:myLongitude, latitude:myLatitude}
on error themessage
	set mylocation to {street:"n/a", city:"n/a", state:"n/a", zipcode:"n/a", country:"n/a", longitude:"n/a", latitude:"n/a"}
	return themessage
end try
return mylocation

You’re missing two handlers: replaceText() and xml_parser().

I see that now! Cheers for the speedy reply, unfortunately the code isn’t mine, I will need to get these handlers, are they hard to write?

Edit
go them, script now works like a beauty! Cheers anyway!