【问题标题】:XML.Load always gives me False - Asp ClassicXML.Load 总是给我 False - Asp Classic
【发布时间】:2013-10-30 16:39:52
【问题描述】:

我想在经典 ASP 中加载一个 XML 文件。

我正在使用

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

success = sXML.LoadXml(url)  

我的 URL 路径给了我一个 XML 文件,但是当我写成功时它给了我错误。

我该怎么办?

同样的代码在我的 VB6 代码中运行良好,我的变量 sucess 给了我真实的信息。它只发生在我的 asp 页面中。

类似帖子:how to load xml file in classic asp

但答案在这个问题上对我没有帮助。

【问题讨论】:

    标签: xml asp-classic vbscript


    【解决方案1】:

    使用sXML.Load(url)

    .LoadXml() 用于加载实际 XML。 The documentation says so,你应该看看。

    我也很确定你的 VB6 应用程序使用了正确的函数,你只是忽略了那个细节。

    【讨论】:

    【解决方案2】:

    试试这个

    xml = Server.CreateObject("Msxml2.DomDocument")
    xml.setProperty "ServerHTTPRequest", true
    xml.async = false
    xml.validateOnParse = false
    xml.load("http://www.url-exemplo.com/xml")
    

    【讨论】:

    • 是的,约翰 我就是这么做的。我将 xml.setProperty "ServerHTTPRequest" 设置为 true,它解决了我的问题。我在之前发布的两个网址中找到了它。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-07-22
    • 1970-01-01
    • 2016-12-06
    • 2013-09-14
    相关资源
    最近更新 更多