作者:沉沉浮浮触涙水 | 来源:互联网 | 2023-05-18 06:31
IamtryingtouseVBScripttodoanXSLTtransformonanXMLobject.TheXSLfileImtranslatingi
I am trying to use Vbscript to do an XSLT transform on an XML object.
The XSL file I'm translating includes the
directive. If I use the absolute URL (http://localhost/mysite/script.xsl
), it imports the style sheet fine; however, if I use the relative path (script.xsl
) it reports "resource not found." I need to be able to port this amongst a set of machines, so I need to be able to use the relative URI. Any suggestions?
我试图使用Vbscript对XML对象进行XSLT转换。我正在翻译的XSL文件包括
指令。如果我使用绝对URL(http://localhost/mysite/script.xsl),它会很好地导入样式表;但是,如果我使用相对路径(script.xsl),它会报告“找不到资源”。我需要能够在一组机器中移植它,所以我需要能够使用相对URI。有什么建议么?
Notes:
笔记:
- Vbscript file is at
http://localhost/myscript.asp
- Vbscript文件位于http://localhost/myscript.asp
- first XSL file is at
http://localhost/mysite/styles.xsl
- 第一个XSL文件位于http://localhost/mysite/styles.xsl
- second XSL file is at
http://localhost/mysite/script.xsl
- 第二个XSL文件位于http://localhost/mysite/script.xsl
- using the relative path
mysite/script.xsl
also does not work
- 使用相对路径mysite / script.xsl也不起作用
Addendum:
附录:
Thanks, everyone, for your answers. The more I dig into the code that is doing this, the stranger it is. myscript.asp
is a rather unusual compilation of code. What happens is styles.xsl
is included in the HTML output of myscript.asp
as an XML chunk (
) and then that chunk is loaded as a stylesheet, using Vbscript, on the client side. This stylesheet is then used to transform an XML chunk that is retrieved via XMLHTTP. So the problem is the context of styles.xsl
is the HTML on the client side and has no relation to where script.xsl
is.
谢谢,大家,谢谢你的回答。我越是深入研究这样做的代码,它就是陌生人。 myscript.asp是一个相当不寻常的代码汇编。 what.xsl作为XML块(
)包含在myscript.asp的HTML输出中,然后在客户端使用Vbscript将该块作为样式表加载。然后,此样式表用于转换通过XMLHTTP检索的XML块。所以问题是styles.xsl的上下文是客户端的HTML,与script.xsl的位置无关。
7 个解决方案