Solved

Urgent - Change XML Load To NON Local?

Posted on 2004-04-08
5
280 Views
Last Modified: 2012-08-14
Is there some simple modifications I can make to make this a HTTP request instead of grabbing the file locally?
My main server just failed so I had to go to a third party server...

      Dim oSRXMLDom, oSRNodes, oSRNode
      set oSRXMLDom = Server.CreateObject("MSXML2.DOMDocument")
      Call oSRXMLDom.Load ("c:\webserver_websites\pmg\search\temp\" & search_string_forward & ".xml")
      Set oSRNodes = oSRXMLDom.selectNodes("/results/hit")
      response.Write holdingspot
      For Each oSRNode In oSRNodes
            Response.Write "<hit count=""" & XMLiCount & """>"
            Response.Write "<title><![CDATA[" & oSRNode.selectSingleNode("title").text & "]]></title>"
            Response.Write "</hit>"      
      Next
      Response.Write "<count>" & XMLiCount & "</count>"
      Set oSRNode = Nothing
      Set oSRNodes = Nothing
Thanks
Bill D
0
Comment
Question by:B_Dorsey
  • 3
5 Comments
 
LVL 15

Accepted Solution

by:
deighc earned 125 total points
ID: 10787805
The Load method accepts a URL, so just use that in place of the file path:

Call oSRXMLDom.Load ("http://www.servername.com/folder/" & search_string_forward & ".xml")

You should also set the async property to false (default is true).

And do yourself a favour: use the true/false return value of the Load method to determine whether or not the document loaded.

     Dim oSRXMLDom, oSRNodes, oSRNode
     set oSRXMLDom = Server.CreateObject("MSXML2.DOMDocument")
     if oSRXMLDom.Load ("http://www.servername.com/folder/" & search_string_forward & ".xml") then
        Set oSRNodes = oSRXMLDom.selectNodes("/results/hit")
        response.Write holdingspot
        For Each oSRNode In oSRNodes
             Response.Write "<hit count=""" & XMLiCount & """>"
             Response.Write "<title><![CDATA[" & oSRNode.selectSingleNode("title").text & "]]></title>"
             Response.Write "</hit>"    
        Next
        Response.Write "<count>" & XMLiCount & "</count>"
        Set oSRNode = Nothing
        Set oSRNodes = Nothing
     else
        ' Doc didn't load so handle this somehow
     end if
     set oSRXMLDom = nothing
0
 
LVL 14

Author Comment

by:B_Dorsey
ID: 10788135
Doesnt work for me.

error '8000000a'
The data necessary to complete this operation is not yet available.

test.asp, line 8


Bill D
0
 
LVL 28

Assisted Solution

by:sybe
sybe earned 125 total points
ID: 10789551
set oSRXMLDom = Server.CreateObject("MSXML2.DOMDocument")
oSRXMLDom.async = False   ' ----< insert this line here, it causes the XML object to wait processing untill the complete xml has loaded
0
 
LVL 14

Author Comment

by:B_Dorsey
ID: 10793096
Still nothing

msxml3.dll error '80004005'

Attempt to modify a read-only node.

test.asp, line 5


Bill D
0
 
LVL 14

Author Comment

by:B_Dorsey
ID: 11201076
sry been a while... death in the family and just getting back on top of things

im gping to split the points for the delay, i have it working somewgere just cant remember where, thx 4 help and sugestions.

billd
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question