xsl-list
[Top] [All Lists]

RE: net.sf.saxon.trans.DynamicError

2005-07-29 15:04:59
Thanks for your reply, Below is the code. The error is on the
variable
selectedRowCount. Please ignore the $groupColumn and
$groupColumnValue
variables, these declared in the main xslt.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
version="2.0">

<xsl:variable name="totalRowCount" select="count(Results/Row)"/>
<xsl:variable name="totalAllocCount"
select="sum(/Results/Row/allocCount)"/>
<xsl:variable name="selectedRowCount"
select="count(Results/Row[*[name()=$groupColumn]=$groupColumnValue
and
filterFlag=0])"/>
<xsl:variable name="allocCount"
select="sum(Results/Row[*[name()=$groupColumn]=$groupColumnValue and
filterFlag=0]/allocCount)"/>

<xsl:template name="Pager">

<xsl:param name="mode"/>

<xsl:if test="$selectedRowCount > 0">

<xsl:variable name="curPage" select="1"/>
<xsl:variable name="lastCount" select="1"/>

<table border="0" width="100%">
<tr>
<td>
        <xsl:choose>
                <xsl:when test="$mode='Order'"> 
                        <xsl:call-template name="OrderFooter"/>
                </xsl:when>
                <xsl:when test="$mode='Trade'">
                        <xsl:call-template name="TradeFooter"/>
                </xsl:when>
        </xsl:choose>
</td>

<td>
<xsl:if test="number($selectedRowCount) &gt; number($maxRows)">
<table cellpadding="0" cellspacing="0" border="0" align="center">
<tr height="15">
<td class="textmid1">
<xsl:choose>
        <xsl:when test="number($rowNumber)-number($maxRows) &gt; 0">
                <A class="pagerHref">
                        <xsl:attribute
name="href">JavaScript:goToPage(<xsl:value-of
select="number($rowNumber)-number($maxRows)"/>,<xsl:value-of
select="$maxRows"/>)</xsl:attribute>
                        &lt;&lt;Prev
                </A>
                &#160;
        </xsl:when>
        <xsl:otherwise>
                &lt;&lt;Prev&#160;
        </xsl:otherwise>
</xsl:choose>
</td>

<xsl:for-each select="1 to $selectedRowCount">
        <xsl:if test="position() = 1">
        <td class="textmid1">
                <xsl:variable name="curPage" select="1"/>
                &#160;
                <xsl:choose>
                <xsl:when test="position() = number($rowNumber)">
                        <xsl:value-of select="$curPage"/> 
                </xsl:when>
                <xsl:otherwise>
                        <A class="pagerHref">
                        <xsl:attribute
name="href">JavaScript:goToPage(<xsl:value-of
select="$curPage"/>,<xsl:value-of
select="$maxRows"/>)</xsl:attribute>
                        <xsl:value-of select="$curPage"/> 
                        </A>
                </xsl:otherwise>
                </xsl:choose>
        </td>
        </xsl:if>
        <xsl:if test="position() mod number($maxRows) = 0">
        <td class="textmid1">
                <xsl:variable name="curPage" select="(position() div
number($maxRows)) + 1"/>
                <xsl:variable name="lastCount" select="position()"/>
                &#160;
                <xsl:choose>
                <xsl:when test="(position()+1) = number($rowNumber)">
                        <xsl:value-of select="$curPage"/>
                </xsl:when>
                <xsl:otherwise>
                        <A class="pagerHref">
                        <xsl:attribute
name="href">JavaScript:goToPage(<xsl:value-of
select="position()+1"/>,<xsl:value-of
select="$maxRows"/>)</xsl:attribute>
                        <xsl:value-of select="$curPage"/>
                        </A>
                </xsl:otherwise>
                </xsl:choose>
        </td>
        </xsl:if>               
</xsl:for-each>

<td class="textmid1">
<xsl:choose>
        <xsl:when test="number($rowNumber)+number($maxRows) &lt;=
number($selectedRowCount)">
                &#160;
                <A class="pagerHref">
                        <xsl:attribute
name="href">JavaScript:goToPage(<xsl:value-of
select="number($rowNumber)+number($maxRows)"/>,<xsl:value-of
select="$maxRows"/>)</xsl:attribute>
                        Next&gt;&gt;
                </A>
        </xsl:when>
        <xsl:otherwise>
                &#160;Next&gt;&gt;
        </xsl:otherwise>
</xsl:choose>
</td>

</tr>
</table>
</xsl:if>

</td>
</tr>
</table>
</xsl:if>

</xsl:template>

<xsl:template name="OrderFooter">
        <xsl:variable name="curMax" select="number($maxRows) +
number($rowNumber) -1"/>
                        
        <table>
        <tr>
                <td>
                        <B>Page No: <xsl:value-of
select="format-number((number($rowNumber) div number($maxRows)) +
1,'#0')"/></B>
                        <span id="legend"
style="font-weight:normal;font-size:12px;color:#5c5c5c;line-height:14px;
text-align:right;font-family: Arial, Helvetica, sans-serif;"> 
                                &lt;&lt;
                                <xsl:value-of
select="$rowNumber"/><xsl:text> thru </xsl:text>
                                <xsl:choose>
                                        <xsl:when test="number($curMax)
&lt;= number($selectedRowCount)">
                                                <xsl:value-of
select="$curMax"/>
                                        </xsl:when>
                                        <xsl:otherwise>
                                                <xsl:value-of
select="$selectedRowCount"/>
                                        </xsl:otherwise>
                                </xsl:choose>
                                &gt;&gt;
                        </span>
                </td>
        </tr>
        <tr>
                <td>
                        <B>Total Blocks: <xsl:value-of
select="$selectedRowCount"/><xsl:text>/</xsl:text><xsl:value-of
select="$totalRowCount"/>&#160;,&#160;</B>
                        <B>Allocations: <xsl:value-of
select="$allocCount"/><xsl:text>/</xsl:text><xsl:value-of
select="$totalAllocCount"/></B>
                </td>
        </tr>
        
        </table>
</xsl:template>

<xsl:template name="TradeFooter">
        <xsl:variable name="curMax" select="number($maxRows) +
number($rowNumber) -1"/>
                        
        <table>
        <tr>
                <td>
                        <B>Page No: <xsl:value-of
select="format-number((number($rowNumber) div number($maxRows)) +
1,'#0')"/></B>
                        <span id="legend"
style="font-weight:normal;font-size:12px;color:#5c5c5c;line-height:14px;
text-align:right;font-family: Arial, Helvetica, sans-serif;"> 
                                &lt;&lt;
                                <xsl:value-of
select="$rowNumber"/><xsl:text> thru </xsl:text>
                                <xsl:choose>
                                        <xsl:when test="number($curMax)
&lt;= number($selectedRowCount)">
                                                <xsl:value-of
select="$curMax"/>
                                        </xsl:when>
                                        <xsl:otherwise>
                                                <xsl:value-of
select="$selectedRowCount"/>
                                        </xsl:otherwise>
                                </xsl:choose>
                                &gt;&gt;
                        </span>
                </td>
        </tr>
        <tr>
                <td>
                        <B>Total Trades: <xsl:value-of
select="$selectedRowCount"/><xsl:text>/</xsl:text><xsl:value-of
select="$totalRowCount"/>&#160;,&#160;</B>
                </td>
        </tr>
        
        </table>
</xsl:template>

</xsl:stylesheet>



                
____________________________________________________
Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--