Parsing XML
am 08.02.2006 00:14:04 von gebeloI'm messing around with a mapping application using the Yahoo online
geocoder.
In my application, the user enters an address search in a form and the
results page loops through the recordset of matching results.
What I want to do is take the address for each matching result and send
it on to the Yahoo geocoder and suck in the latitude and longitude.
So inside my loop, I have this:
<%
url =
"http://api.local.yahoo.com/MapsService/V1/geocode?appid=myy ahooid&street="&rs("location")&chr(38)&"city="&rs("townname" )&chr(38)&"state=NJ"
set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP")
xmlhttp.open "GET", url, false
xmlhttp.send ""
straddress=xmlhttp.responseText
response.write straddress&"
"
set xmlhttp = nothing
%>
This code creates a variable straddress for each record that contains
this chunk of XML:
xmlns="urn:yahoo:maps" xsi:schemaLocation="urn:yahoo:maps
http://api.local.yahoo.com/MapsService/V1/GeocodeResponse.xs d">
MINELL
PL
What's the easiest way to examine that chunk and pull out
strlatitude = 40.887163
strlongitude = -74.002151
TIA...