Wrox Programmer Forums
Classic ASP XML Using ASP 3 and XML. See also the XML category for more XML discussions not relating to ASP. NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old December 8th, 2006, 10:24 PM
Authorized User
Join Date: Jan 2006
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default I cant retrieve XMl child nodes


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?
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.

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get the size of the child nodes. eruditionist XSLT 2 November 7th, 2008 11:59 AM
not able to print out the child nodes eruditionist XSLT 7 October 30th, 2008 10:33 AM
How can I display parent & child nodes if XML .... vishnu108mishra ASP.NET 2.0 Basics 0 November 17th, 2007 07:45 AM
Retrieveal of child nodes.... nathilson21 Classic ASP XML 0 May 7th, 2007 04:54 AM
counting child nodes Tomi XSLT 1 September 6th, 2006 03:26 AM

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