【发布时间】:2014-03-22 23:48:13
【问题描述】:
我正在开发一个用经典 ASP (VBScript) 编写的旧软件。
我应该创建一个进行 XSL 转换的 asp 页面。我可以使用静态文件来做到这一点,但我必须使用由 asp 页面动态生成的 XML 文件(这不起作用)。
这是我的代码:
Dim document, stylesheet, o
Set document = Server.CreateObject("Msxml2.DOMDocument")
document.async = False
Set o = CreateObject("MSXML2.XMLHTTP")
o.open "GET", "http://localhost/aaa/cgi-bin/fo/file.asp?id_x=39", False
o.send
'document.load Server.MapPath("test.xml") ' <- with static file is working
'document.loadXML(o.responseText) ' <- not working
document.load o.responseXML ' <- not working
Set stylesheet = Server.CreateObject("Msxml2.DOMDocument")
stylesheet.async = False
stylesheet.load Server.MapPath("test.xslt")
'Response.Write o.responseText ' <- working! (return the correct XML)
'Response.Write o.responseXML.xml ' <- not working (empty result)
Response.Write document.transformNode(stylesheet)
Set document = Nothing
Set stylesheet = Nothing
一切都在装有 Windows 2000 Server 的虚拟机上运行(不幸的是,我需要这样做)。
感谢您的帮助。
【问题讨论】:
标签: xml xslt vbscript asp-classic