View Single Post
  #1 (permalink)  
Old December 8th, 2006, 10:24 PM
jfergy jfergy is offline
Authorized User
Join Date: Jan 2006
Location: , , .
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") "GET", "", 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) %>
Reply With Quote