Welcome to WebmasterWorld Guest from 54.144.77.26

Forum Moderators: httpwebwitch

Message Too Old, No Replies

xml parsing with asp

     

cybotron

4:55 pm on Feb 15, 2010 (gmt 0)

5+ Year Member



Hi Guys,

I am trying to parse xml with asp and display the results but i am having some trouble. I dont know whether i am doing this in the right way as I am fairly new to xml.

Also how do I know which nodes to select from the xml?

The error i get is:

Microsoft VBScript runtime (0x800A01A8)
Object required


The code I am using is:

########################################

<%
Set objXML = Server.CreateObject("Microsoft.XMLDOM")
Set objLst = Server.CreateObject("Microsoft.XMLDOM")
objXML.async = false
objXML.setProperty "ServerHTTPRequest", true

string_url = "http://www.example.com/request.php?auth=FFFFFFFFFFFFFFFFFFFF&type=query&..."

objXML.Load (string_url)


Set objLst = objXML.getElementsByTagName("LISTING")
intNoOfElements = objLst.length


%>

<HTML><BODY>
<H1>Shopping</H1>

<%
For i = 0 To (Products)

Set objHdl = objLst.item(i)

Response.Write("" & objHdl.childNodes(1).text & "")


Next
%>

</BODY></HTML>

################################


Thanks in advance.

Cybotron

[edited by: httpwebwitch at 4:49 pm (utc) on Feb 17, 2010]
[edit reason] examplified an API URL [/edit]

httpwebwitch

4:48 pm on Feb 17, 2010 (gmt 0)

WebmasterWorld Administrator httpwebwitch is a WebmasterWorld Top Contributor of All Time 10+ Year Member



seems to me that Products is undefined in your "for" loop