I’m trying to modify and existing project in order to add some features. I would like to pass some parameters to my xsl stylesheet, but any use of parameters causes an error. I’ve tried inserting the simplest examples found in tutorials, etc. to no avail. I believe the problem may be with the version of xslt being used?
<?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>
I’ve removed all of the other code in order to keep the example as simple as possible. According to my understanding, this code should simply output TEST on the html page. However, what I get is a classic IIS error:
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.
Does anyone have any insight as to why this is happening? The same problem occurs when I try to use variables in any way. Is it a problem with my Web Server, or the version of xslt being used?
Thank you for your help!
Expanding on Michael Kay’s answer, Microsoft may be dropping support for the old legacy “http://www.w3.org/TR/WD-xsl” namespace, so it can’t be guarenteed to work much longer. This is certainly the case for IE9, as explained on MSDN
http://msdn.microsoft.com/en-gb/library/ie/hh180178(v=vs.85).aspx
I recently had to change an XSLT stylesheet that was using “http://www.w3.org/TR/WD-xsl” to get it to work in IE9. It might be just a simple case of changing it to use the correct namespace of “http://www.w3.org/1999/XSL/Transform”, but you might also have to make changes if you are using constructs that are not actually supported in the current namespace. These are the things I noticed that were supported in the legacy one, but not in the current
xsl:sort instead.