You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Jason Uithol <ja...@datacodex.net> on 2002/07/01 03:18:27 UTC

RE: Xalan Variable Bug

Hello all,

I think I am experiencing the same bug as Scott.  I am having trouble with a
Parameter that changes value right in the middle of a template.  I could
probably get a simple example of this bug going, since for me it takes only
three stylesheets to get this to happen.

However, it would take a bit of time and I will only do it upon request from
someone who wants to fix the bug.  This bug is part of a series of bugs I am
experiencing whilst trying to get ESQL working on Cocoon2.0.2 under JDK1.4.

FYI: I am using Xalan-2.3.1 on JDK1.4

Oh yeah, it's a weird bug.  The "proper" value for my global param is
"abc-def-hij-klm".  Then I create a different variable ( local ) and
populate it by calling a template:

<xsl:variable name="someUnrelatedParam"><xsl:call-template
name="unrelatedTemplate"/></xsl:param>

That template doesn't even reference the global param.  The template that
this gets called from matches itself recursively.  On each match, it calls
the call-template and the called template evaluates to, say "FRED", "MARY",
"JAMES", "ANNA", "ALBERT", "BELINDA" on each successive call.



<xsl:param name="myGlobal"/>

<xsl:template match="*">

	<!-- Global is correct here -->
	<xsl:variable name="someUnrelatedParam"><xsl:call-template
name="unrelatedTemplate"/></xsl:param>
	<!-- Global is incorrect here -->

	<b>Using variables in typical example:
		<xsl:value-of select="$someUnrelatedParam"/><br/>
		<xsl:value-of select="$myGlobal"/>
	</b>

	<xsl:apply-templates match="*"/><!-- This matches this template for a
number of times -->

</xsl:template>



The values of the global become: ( printed just before the evaluation of the
call-template )

before: "abc-def-hij-klm"
before: "FREDdef-hij-klm"
before: "FREDMARYhij-klm"
before: "FREDMARYJAMESlm"
before: "FREDMARYJAMESAN"
before: "FREDMARYJAMESAN"

I hope this helps trigger some buried subliminal thought somewhere.  If
not - I can be pressed into providing a reproduction.



Jason Uithol


-----Original Message-----
From: Scott Moore [mailto:puffandtoot@cox.net]
Sent: Saturday, 29 June 2002 7:32 AM
To: xalan-dev@xml.apache.org
Subject: Re: Xalan Variable Bug


Okay, here's the test case.  I had to chop it up by hand and greek it, but
it still can be used to reproduce the problem.

Sorry about the number of files, but I just don't have enough time to make
it as small as possible.  You should see what I started with....

In any case, Driver.xsl is the main stylesheet.  At the end of the
stylesheet, I output the variable $Joint, which is erroneously blank.

If you uncomment the <xsl:message> at the beginning, it will output 1
correctly at the end of the stylesheet.

Please let me know if you need any other assistance.  I would very much like
a 2.3.2 version!  :)

Thanks,
Scott

----- Original Message -----
From: Joseph Kesselman
To: xalan-dev@xml.apache.org
Sent: Friday, June 28, 2002 5:27 PM
Subject: Re: Xalan Variable Bug


If the value is OK early on and getting bashed later... We had some bugs
that were causing us to overwrite variables. All the ones I know of should
be fixed in current code. It's possible you've found another. Or you could
be explicitly assigning a new value to the variable; hard to tell without a
testcase...

______________________________________
Joe Kesselman / IBM Research