Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Urgent - Change XML Load To NON Local?

Posted on 2004-04-08
5
Medium Priority
?
285 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 15

Accepted Solution

by:
deighc earned 500 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 500 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
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…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

610 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