I have an xsl:variable that can be either the empty string or a number. So I evaluate it like this:
<xsl:if test="number($var)"><node att="{number($var)}" /></xsl:if>
This works if var is the empty string, but it has the same effect if var is 0:
From -2 to 2:
<node att="-2" />
<node att="-1" />
<node att="1" />
<node att="2" />
Is this a bug? Is there a different version of the number function that also captures 0? Do I really have to add or $var = '0' to my test statement?