You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Tom LeRoux <to...@kargo.com> on 2000/08/17 15:51:15 UTC
xsl:param in xsl:output not expanding...
Howdy group.
I'm trying to create a stylesheet which will output in different encodings
based on a stylesheet parameter.
So, I whipped up the following test case. To my dismay, the param
"encoding" does not get expanded in the xsl:output tag, but does get
expanded in a template. I'm sure I read that the scope of a stylesheet
parameter was global, so I'm not quite sure why this doesn't work. Any help
before I start digging?
Thanks.
-Tom
--- foo.xsl -----------------------
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="encoding" select="'UTF-8'"/>
<xsl:output encoding="$encoding"/>
<xsl:template match="foo">
Encoding should be <xsl:copy-of select="$encoding"/>
</xsl:template>
</xsl:stylesheet>
--- foo.xml ------------------------
<?xml version="1.0" encoding="UTF-8"?>
<foo/>
--- output -------------------------
<?xml version="1.0" encoding="$encoding"?>
Encoding should be UTF-8