Solved

Urgent - Change XML Load To NON Local?

Posted on 2004-04-08
5
276 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

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 information …
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now