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.

Community
  • 1
  • 1

2 Answers2

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.

Tomalak
  • 332,285
  • 67
  • 532
  • 628
  • I had the same problema using .load(url) =/ – Francisco Proença Oct 30 '13 at 17:04
  • I found the solution, in this links: =D http://forums.aspfree.com/asp-development-5/xmldom-object-error-parse-91519.html http://forums.aspfree.com/code-bank-54/read-xml-url-91854.html – Francisco Proença Oct 30 '13 at 19:47
  • The other thread you've linked to in your question said it would be in `.parseError.reason`. Please include such error messages in your question next time. – Tomalak Oct 30 '13 at 19:56
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")
John
  • 4,658
  • 2
  • 14
  • 23
  • Yes, John It was that I did. I set xml.setProperty "ServerHTTPRequest", true and it solve my problem. I found it to in the two URLs which I post before. – Francisco Proença Oct 31 '13 at 11:59