p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Classic ASP XML (http://p2p.wrox.com/forumdisplay.php?f=69)
-   -   I cant retrieve XMl child nodes (http://p2p.wrox.com/showthread.php?t=51324)

jfergy December 8th, 2006 10:24 PM

I cant retrieve XMl child nodes
 
Hello-

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!

-------------------
Code:

<%
' Start out declaring our variables.
' You are using Option Explicit aren't you?
Dim objXmlHttp
Dim strHTML

' 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.
objXmlHttp.send

' 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) %>



All times are GMT -4. The time now is 07:55 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.