I can retieve the full xml document using the following code. How can I access Child nodes in the document to output as variables in the page? I have a variable called address below which shows what i am trying to do. Im stuck on the correct property syntax.
Thanks in advance!
' Start out declaring our variables.
' You are using Option Explicit aren't you?
' This is the server safe version from MSXML3.
Set objXmlHttp = Server.CreateObject("Msxml2.ServerXMLHTTP")
objXmlHttp.open "GET", "http://www.zillow.com/webservice/GetSearchResults.htm?zws-id=X1-ZWz1chbc4lnj0r_56tmg&address=1810+Hardy+Dr&citystatezip=95776", False
' Send it on it's merry way.
' Print out the request status:
Response.Write "Status: " & objXmlHttp.status & " " _
& objXmlHttp.statusText & "<br />"
' Get the text of the response.
' This object is designed to deal with XML so it also has the
' following properties: responseBody, responseStream, and
' responseXML. We just want the text so I use:
strHTML = objXmlHttp.responsetext
'Address = objXmlHttp.DocumentElement.SelectNodes("citystatezip")
' Trash our object now that I'm finished with it.
Set objXmlHttp = Nothing
' All that's left to do is display the HTML we just retreived.
' I do it first as plain HTML (which gets interpretted by the
' browser like any other HTML) and then as source (by HTML
' encoding it so the tags display instead of rendering)
' The <h1>s and <table>s are just for appearence.
This is the called code: <%= Address%>
<%= strHTML %>
<%= Server.HTMLEncode(strHTML) %>