Sort Before Paging

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

<xsl:param name="M" select="1"/>
<xsl:param name="N" select="20"/>
<xsl:template match="/">
<xsl:apply-templates select="record[position() &gt;= $M and position
&lt;=
$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() &gt;= $M and position
&lt;= $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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,156
Latest member
KetoBurnSupplement
Top