Subject: RE: [xsl] net.sf.saxon.trans.DynamicError From: Santosh N <ss1722@xxxxxxxxx> Date: Fri, 29 Jul 2005 15:04:59 -0700 (PDT) |
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) > 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) > 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> <<Prev </A>   </xsl:when> <xsl:otherwise> <<Prev  </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"/>   <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()"/>   <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) <= number($selectedRowCount)">   <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>> </A> </xsl:when> <xsl:otherwise>  Next>> </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;"> << <xsl:value-of select="$rowNumber"/><xsl:text> thru </xsl:text> <xsl:choose> <xsl:when test="number($curMax) <= number($selectedRowCount)"> <xsl:value-of select="$curMax"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="$selectedRowCount"/> </xsl:otherwise> </xsl:choose> >> </span> </td> </tr> <tr> <td> <B>Total Blocks: <xsl:value-of select="$selectedRowCount"/><xsl:text>/</xsl:text><xsl:value-of select="$totalRowCount"/> , </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;"> << <xsl:value-of select="$rowNumber"/><xsl:text> thru </xsl:text> <xsl:choose> <xsl:when test="number($curMax) <= number($selectedRowCount)"> <xsl:value-of select="$curMax"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="$selectedRowCount"/> </xsl:otherwise> </xsl:choose> >> </span> </td> </tr> <tr> <td> <B>Total Trades: <xsl:value-of select="$selectedRowCount"/><xsl:text>/</xsl:text><xsl:value-of select="$totalRowCount"/> , </B> </td> </tr> </table> </xsl:template> </xsl:stylesheet> ____________________________________________________ Start your day with Yahoo! - make it your home page http://www.yahoo.com/r/hs
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] net.sf.saxon.trans.Dynami, Michael Kay | Thread | Re: [xsl] net.sf.saxon.trans.Dynami, David Carlisle |
RE: [xsl] find position of first oc, Michael Kay | Date | Re: [xsl] net.sf.saxon.trans.Dynami, David Carlisle |
Month |