You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Scott Moore <pu...@cox.net> on 2002/06/28 21:55:37 UTC

Xalan Variable Bug

I've found a bug in Xalan 2.3.1, but I haven't been able to duplicate the
error in a small testable stylesheet.  The stylesheets I'm using are rather
large and contains proprietary information that makes it difficult to submit
to bugzilla.

The problem:

I have a variable declared like this:

 <xsl:variable name="Joint">
  <xsl:choose>
   <xsl:when
test="/Session/Plan/Client/FullClientInfoList/FullClientInfo[entity_type=2]"
>1</xsl:when>
   <xsl:otherwise>0</xsl:otherwise>
  </xsl:choose>
 </xsl:variable>


Throughout the stylesheet, I have the following tests:

<xsl:if test="$Joint = 1">....</xsl:if>

However, the code inside the if tests NEVER gets executed UNLESS I do this
at the very beginning of the stylesheet:
<xsl:message>Value of joint is <xsl:value-of select="$Joint"/></xsl:message>

When I do this, the message gets printed to stdout with the correct value
for $Joint (1 in this case) and the stylesheet works correctly.  If I erase
the <xsl:message> then most of the stylesheet output is incorrect.


If I put the <xsl:message> at the end of the stylesheet, the value for
$Joint gets output as "h"?!  Very bizarre.


I guess I'm looking for guidance on how to proceed.  Is this a known bug?
I'll keep trying to reproduce this in a small stylesheet or at least a
stylesheet that isn't proprietary, but I wish there was a faster way to do
this.

Thanks for any help,
Scott