我试图修改和现有项目以添加一些功能。我想将一些参数传递给我的xsl样式表,但任何参数的使用都会导致错误。我尝试插入教程中找到的最简单的例子等无济于事。我相信这个问题可能与正在使用的xslt版本有关?使用<xsl:param>和<xsl:variable>在服务器上导致错误
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl" language="VBScript">
<xsl:param name="test">TEST</xsl:param>
<xsl:template match="/">
<xsl:value-of select="$test"></xsl:value-of>
</xsl:template>
</xsl:stylesheet>
我已经删除了所有其他代码,以保持示例尽可能简单。根据我的理解,这段代码应该简单地在HTML页面上输出TEST。不过,我得到的是一个典型的IIS错误:
An error occurred on the server when processing the URL. Please contact the system administrator.
If you are the system administrator please click here to find out more about this error.
没有人有任何见解,为什么这是怎么回事?当我尝试以任何方式使用变量时,会发生同样的问题。这是我的Web服务器的问题,还是使用了xslt的版本?
谢谢你的帮助!
什么是'language =“VBScript”'for? – xiaoyi
什么是服务器技术和XSLT处理器? IIS和MSXML? Apache/Tomcat和...? –
'http:// www.w3.org/TR/WD-xsl'不是XSLT的正确命名空间URI,它应该是'http:// www.w3.org/1999/XSL/Transform',并且您需要在''元素上使用'version =“1.0”'(或'version =“2.0”')。 –