<
[email protected]>:
[problems passing space as a parameter to a template]
Yes, that's how they're being passed but when I use this
syntax, <xsl:with-param name="p" select="' '"/>, I get an
'Empty expression' error from the processor (XALAN). Isn't
the 'select' attribute reserved for nodes?
No.
I've been using
"<xsl:with-param name="p"> </xsl:with-param>" to no avail.
Works just fine for me with xsltproc, Saxon-8B, xalan-c++:
pavel@debian:~/dev/xslt$ a param_space.xsl
<xsl:stylesheet version="1.0"
xmlns:xsl="
http://www.w3.org/1999/XSL/Transform">
<xsl
utput indent="yes"/>
<xsl:template match="/">
<xsl:call-template name="named">
<xsl:with-param name="str" select="' '"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="named">
<xsl
aram name="str"/>
<result>
<xsl:value-of select="$str"/>
</result>
</xsl:template>
</xsl:stylesheet>
pavel@debian:~/dev/xslt$ xsltproc param_space.xsl
param_space.xsl
<?xml version="1.0"?>
<result> </result>
pavel@debian:~/dev/xslt$ saxon -t param_space.xsl
param_space.xsl
Saxon 8.8J from Saxonica
Java version 1.5.0_11
Warning: at xsl:stylesheet on line 2 of
file:/var/www/dev/xslt/param_space.xsl:
Running an XSLT 1.0 stylesheet with an XSLT 2.0 processor
Stylesheet compilation time: 892 milliseconds
Processing file:/var/www/dev/xslt/param_space.xsl
Building tree for file:/var/www/dev/xslt/param_space.xsl
using class net.sf.saxon.tinytree.TinyBuilder
Tree built in 4 milliseconds
Tree size: 24 nodes, 0 characters, 9 attributes
<?xml version="1.0" encoding="UTF-8"?>
<result> </result>Execution time: 138 milliseconds
Memory used: 576184
NamePool contents: 14 entries in 14 chains. 7 prefixes, 8
URIs
pavel@debian:~/dev/xslt$ xalan -in param_space.xsl -xsl
param_space.xsl
<?xml version="1.0" encoding="UTF-8"?>
<result> </result>
pavel@debian:~/dev/xslt$
Perhaps the problem lies elsewhere. Try reproducing it in a
minimum possible transformation.