Page 1 of 1
XSLT debugger doesn't display numerical variable values
Posted: Sun Dec 10, 2006 5:24 am
Another bug in the XSLT debugger. Numerical variables don't seem to display correctly.
For example, a new stylesheet with a template
will display "N/A" in the value column of the variables view for the variable la when at a breakpoint on the "apply-templates" element.
This is a problem in both the eclipse plugin and the standalone version of oxygen 8.0
Posted: Mon Dec 11, 2006 4:12 pm
I think you use Saxon 8B and the variable "la" is declared but is never used by the stylesheet. This is the only situation when I could get the N/A value. Saxon 8B evaluates the variable only if you use it, for example with
Incorrect display of variables in XSLT debug
Posted: Wed Dec 13, 2006 5:47 am
I can give a better example of this problem. With the stylesheet attached below, when paused at the value-of tag, the variables pane displays $meBitCount with a "?" in the type column and nothing in the value column. Selecting the variable does nothing.
However, if I type $meBitCount into the xwatch pane, it tells me that I have a node set containing an empty document fragment. This information is very useful to me and it would be great if I could see it directly in the variables pane without having to enter the expression in xwatch.
This is using Oxygen 8.0, Windows Vista and JDK1.6.0RC.
<xsl:variable name="thisBitCount" select="if ($meBitCount='') then 9999 else $meBitCount"/>
<xsl:variable name="bitCount" select="min(($baseBitCount,xsd:integer($thisBitCount)))"/>
Posted: Wed Dec 13, 2006 11:25 am
The issue is with the lazy evaluation of variables. oXygen presents what it is in the XSLT processors and in that case the variable is evaluated when it is used, not when it is declared, if you enter an expression in the XWatch view then you force the evaluation of that variable.
Hope that helps,
Variables displaying N/A
Posted: Thu Dec 14, 2006 7:16 am
Thanks for the explanation. From a users perspective I feel it would be better for debug mode to always force evaluation of in-scope variables and always display their value in the variables pane.
If one is stepping through the code then the extra time required to evaluate the variables is very unlikely to be a problem.
Posted: Thu Dec 14, 2006 5:31 pm
Sorry, the XSLT processors do not offer that option. They do not send notifications about variable declarations if the variable is not used. The value of the variable is known only when the processor evaluates it.