use-when expressions are evaluated at compile time, and the values of variables are not available until run-time. So you can't refer to variables from a use-when expression. Try referring to a Java system property instead:
<span xsl:use-when="system-property('isFeatured')='yes'">content</span>
and setting this from the command line
java -DisFeatured=yes net.sf.saxon.Transform...
Michael Kay

From: [] On Behalf Of max toro q
Sent: 25 April 2008 15:40
Subject: [saxon] xsl:use-when

Hello Michael,
I was trying to use xsl:use-when but it is not finding a variable.
This works:
<xsl:if test="$is-featured">
This doesn't:
<span xsl:use-when="$is-featured">content</span>
Saxon.Api.StaticError: Error in use-when expression. XPath syntax error at char 12 on line 224 in {$is-featured}:
   Variable $is-featured has not been declared
I'm using on .net