C
Chan
I have about 1,000 records in my XML to be shown. It's too much to
display all of them at once. So, paging is a good implementation.
I'm doing all this at client side, that is,
- xml dataisland
- client-side xslt
- client-side script (Java or VB)
for the purpose of performance and less load at web server.
To achieve paging, Michael Kay has given an example
(http://www.biglist.com/lists/xsl-list/archives/200011/msg00142.html)
using
<xslaram name="M" select="1"/>
<xslaram name="N" select="20"/>
<xsl:template match="/">
<xsl:apply-templates select="record[position() >= $M and position
<=
$N]"/>
</xsl:template>
Now, supposed users want sorting and paging combined with sorting taking place
first. Since <xsl:sort> is the child element of <xsl:apply-templates>, it
becomes,
....
<xsl:template match="/">
<xsl:apply-templates select="record[position() >= $M and position
<= $N]">
<xsl:sort select="something" order="ascending"/>
</xsl:apply-templates>
</xsl:template>
But doing so will only sort nodes within the page, not overall.
Any clue?
Thanks.
display all of them at once. So, paging is a good implementation.
I'm doing all this at client side, that is,
- xml dataisland
- client-side xslt
- client-side script (Java or VB)
for the purpose of performance and less load at web server.
To achieve paging, Michael Kay has given an example
(http://www.biglist.com/lists/xsl-list/archives/200011/msg00142.html)
using
<xslaram name="M" select="1"/>
<xslaram name="N" select="20"/>
<xsl:template match="/">
<xsl:apply-templates select="record[position() >= $M and position
<=
$N]"/>
</xsl:template>
Now, supposed users want sorting and paging combined with sorting taking place
first. Since <xsl:sort> is the child element of <xsl:apply-templates>, it
becomes,
....
<xsl:template match="/">
<xsl:apply-templates select="record[position() >= $M and position
<= $N]">
<xsl:sort select="something" order="ascending"/>
</xsl:apply-templates>
</xsl:template>
But doing so will only sort nodes within the page, not overall.
Any clue?
Thanks.