Subject:Wrong value in variable (faulty arithmetic?) Author:Bill Cohagan Date:11 Jul 2004 04:14 PM
I'm a new user (evaluation version) and am attempting to debug an XSL.
As I F11 through a template I am viewing values of variables and the values
being displayed are incorrect. Here are two variable definitions:
<xsl:variable name="First" select="count(w:p[generate-id() = $NextNode]/preceding-sibling::*)" />
<xsl:variable name="FirstPosition" select = "$First + 1"/> <!-- Position of "this" subp-statement paragraph -->
The first variable is correctly displayed as "1", but the second is also
displayed as "1", obviously incorrect. The problem actually appears to be
an engine problem rather than just a display problems.
Have I missed something fundamental or is there a problem with arithmetic
operations in this product?
Subject:Re: Wrong value in variable (faulty arithmetic?) Author:Bill Cohagan Date:12 Jul 2004 09:28 AM
Minolo
Attached is a Zip containing the xml input, the xsl file, and the project file. Of course the project file reflects my actual folder structure so it'd require an edit. Anyway, put a breakpoint on <xsl:template match="ns0:SubpracticeSet">, start debugging and when it breaks you only need to step a few times before reaching the xsl:variable lines in question. Be sure to have variable display turned on.
Subject:Re: Wrong value in variable (faulty arithmetic?) Author:Minollo I. Date:12 Jul 2004 04:28 PM
Thanks for the testcase.
The problem is related to the display of variable values and ONLY when
setting Stylus Studio to use the XSLT .NET processor in the scenario
properties. The issue only affects the value displayed in the variable
window, and not the one internally handled by the processor. A quick
workaround would be to rename your "First" variable definition and use into
"First_".
We are of course investigating further, and we will make a fix available as
soon as possible.
Subject:Re: Wrong value in variable (faulty arithmetic?) Author:Bill Cohagan Date:12 Jul 2004 06:12 PM
Minollo
Thanks for the response, but I'm afraid I don't understand the workaround. Are you suggesting that just changing the name from First to First_ will cure the problem?
Subject:Re: Wrong value in variable (faulty arithmetic?) Author:Minollo I. Date:13 Jul 2004 05:15 PM
That's correct.
The problem is with the internal interface to the .NET XSLT engine which is currently confusing variable names beginning with the same group of characters ($First and $FirstPosition in your case).