0

I want to load one XML file in classic ASP.

I am using

url = "http://www.url-exemplo.com/xml"

success = sXML.LoadXml(url)  

My URL path gives me a XML file, but when I write success it gives me false.

What should I do?

This same code works fine in my VB6 code, my variable sucess gives me true. It only happen in my asp page.

Similar post: how to load xml file in classic asp

But the answers don't help me in this issue.

4

2 回答 2

1

Use sXML.Load(url).

.LoadXml() is for loading actual XML. The documentation says so, you should read it.

I'm also pretty sure that your VB6 application uses the right function, you've just overlooked that detail.

于 2013-10-30T16:53:32.000 回答
0

Try this

xml = Server.CreateObject("Msxml2.DomDocument")
xml.setProperty "ServerHTTPRequest", true
xml.async = false
xml.validateOnParse = false
xml.load("http://www.url-exemplo.com/xml")
于 2013-10-31T02:38:24.380 回答