Hi,
gingerAll,
The problems below did not manifest themselves in
the 0.50 but strangely they occur with the Velocigen's perl interpreter
(uses libperl.so 5.6.x) with XML::Sablotron version 0.52. Perl
scripted page that uses XML::Sablotron dies quietly on the following XSL
code fragments.
1. Recursive template calls
<xsl:template
name="pager1">
<xsl:param name="current"/>
<xsl:param name="finish"/>
<xsl:choose>
<xsl:when test="$current=$currentPage">
<xsl:value-of select="$current"/>
</xsl:when>
<xsl:otherwise>
<a>
<xsl:attribute name="href">
<xsl:text>javascript:goPage(</xsl:text>
<xsl:value-of select="$current"/>
<xsl:text>)</xsl:text>
</xsl:attribute>
<xsl:value-of select="$current"/>
</a>
</xsl:otherwise>
</xsl:choose>
<xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>
<xsl:if test="($current - $finish) < 0">
<xsl:call-template name="pager1">
<xsl:with-param name="current"><xsl:value-of select="$current + 1"/></xsl:with-param>
<xsl:with-param name="finish"><xsl:value-of select="$finish"/></xsl:with-param>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:param name="current"/>
<xsl:param name="finish"/>
<xsl:choose>
<xsl:when test="$current=$currentPage">
<xsl:value-of select="$current"/>
</xsl:when>
<xsl:otherwise>
<a>
<xsl:attribute name="href">
<xsl:text>javascript:goPage(</xsl:text>
<xsl:value-of select="$current"/>
<xsl:text>)</xsl:text>
</xsl:attribute>
<xsl:value-of select="$current"/>
</a>
</xsl:otherwise>
</xsl:choose>
<xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>
<xsl:if test="($current - $finish) < 0">
<xsl:call-template name="pager1">
<xsl:with-param name="current"><xsl:value-of select="$current + 1"/></xsl:with-param>
<xsl:with-param name="finish"><xsl:value-of select="$finish"/></xsl:with-param>
</xsl:call-template>
</xsl:if>
</xsl:template>
2. use of template variable in the
test ($currentPage and $pages are global XSL
stylesheet parameters)
<xsl:template
name="pager">
<xsl:variable name="maxpages">21</xsl:variable>
<xsl:variable name="startPage">
<xsl:choose>
<xsl:when test="(($pages - $maxpages) <= 0) or (($currentPage - ($maxpages div 2) <= 0))">1</xsl:when>
<xsl:otherwise><xsl:value-of select="($currentPage - ceiling($maxpages div 2)) + 1"/></xsl:otherwise>
</xsl:choose>
</xsl:variable>
</xsl:template>
<xsl:variable name="maxpages">21</xsl:variable>
<xsl:variable name="startPage">
<xsl:choose>
<xsl:when test="(($pages - $maxpages) <= 0) or (($currentPage - ($maxpages div 2) <= 0))">1</xsl:when>
<xsl:otherwise><xsl:value-of select="($currentPage - ceiling($maxpages div 2)) + 1"/></xsl:otherwise>
</xsl:choose>
</xsl:variable>
</xsl:template>
if I replace variable with the constant it works fine
:
<xsl:template name="pager">
<xsl:variable name="startPage">
<xsl:choose>
<xsl:when test="(($pages - 21) <= 0) or (($currentPage - (21 div 2) <= 0))">1</xsl:when>
<xsl:otherwise><xsl:value-of select="($currentPage - ceiling(21 div 2)) + 1"/></xsl:otherwise>
</xsl:choose>
</xsl:variable>
</xsl:template>
<xsl:variable name="startPage">
<xsl:choose>
<xsl:when test="(($pages - 21) <= 0) or (($currentPage - (21 div 2) <= 0))">1</xsl:when>
<xsl:otherwise><xsl:value-of select="($currentPage - ceiling(21 div 2)) + 1"/></xsl:otherwise>
</xsl:choose>
</xsl:variable>
</xsl:template>
Again the scripts will work well if just run as the
standalone perl script but will fail within perl embedded
engines.
Any idea what change in 0.52 as opposed to 0.50 could
have caused this?!
Thanks.
Nick Semenov
