Solved

Urgent - Change XML Load To NON Local?

Posted on 2004-04-08
5
278 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

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
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/…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

778 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