?
Solved

Urgent - Change XML Load To NON Local?

Posted on 2004-04-08
5
Medium Priority
?
284 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

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

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…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

765 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