RE: [xsl] net.sf.saxon.trans.DynamicError

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) &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 

Current Thread