Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set xml = Server.CreateObject ("Mic

Status
Not open for further replies.

amiw

Programmer
Apr 1, 2003
113
GB
Set xml = Server.CreateObject ("Microsoft.XMLHTTP")
xml.Open "GET", " false'
xml.send
Set objDom = Server.CreateObject("Microsoft.XMLDOM")
objDom.async = False
objDom.LoadXML (xml.ResponseText)

Set objRoot = objDom.documentElement
resultLength=Cint(objRoot.selectNodes("SITE").length)
response.write &quot;There are &quot; & resultLength & &quot; SITE Nodes.<br>&quot;

For iCount= 1 to CInt(resultLength)
set Node = objRoot.selectSingleNode(&quot;RESULTS/SITE/[@I=&quot; & CInt(iCount)& &quot;]&quot;)
Next
%>

below is the error i get

There are 5 SITE Nodes.
msxml3.dll error '80004005'
Unexpected token '['. RESULTS/SITE/-->[<--@I=1]
/adult/xml/feed.asp, line 15


and here's the outline of the xml file
<?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot; ?>
<RESULTS>
<RC>34</RC>
<O>1</O>
<S>5</S>
<SITE I=&quot;1&quot;>
<SITE I=&quot;2&quot;>
<SITE I=&quot;3&quot;>
<SITE I=&quot;4&quot;>
<SITE I=&quot;5&quot;>
</RESULTS>
 
Just a quick look without testing I notice that this expression:

RESULTS/SITE/[@I=&quot; & CInt(iCount)& &quot;]&quot;

should have the 2nd back slash removed like this:

RESULTS/SITE[@I=&quot; & CInt(iCount)& &quot;]&quot;)

Hope that is your fix!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top