Paging Using XSLT -- Too Many Unknowns

Subject: Paging Using XSLT -- Too Many Unknowns
From: Bharat.Chintapally@xxxxxxxxxxxxxxxxx
Date: Tue, 7 Nov 2000 11:50:41 -0500
     I am trying to use XSLT to present some XML data in HTML tables. I
need to implement a paging mechanism to let users navigate to previous and
next pages etc. I came up with something like the following but I have the
following few(?) questions. Sorry for posting this long mail, but any help
or pointers are really appreciated.

   I am unable to set the scope of the <xsl:param>, I would like to set the
   scope to global and be able to change it from my script when the user
   clicks on the next or previous buttons
   In the client side script how do I set the param on the xslt processor,
   I could not find any useful examples in the xmlsdk samples.
   Am I doing it right?

Original XML document:

 <?xml version='1.0'?>
<?xml-stylesheet type="text/xsl" href="Test.xsl" ?>
<Status xmlns:HTML="";>
     <Uow uuid="345"><senderId>BNBN</senderId><docId>2</docId></Uow>
     <Uow uuid="678"><senderId>AMZN</senderId><docId>3</docId>
     </Uow><Uow uuid="910"><senderId>EBAY</senderId><docId>4</docId></Uow>
     <Uow uuid="999"><senderId>INDUS</senderId><docId>5</docId></Uow>

Original stylesheet:
<xsl:stylesheet version="1.0" xmlns:xsl
=""; xmlns:HTML
<xsl:template match="/">
  <xsl:variable name="maxItemsPage" select="2"/>

        <SCRIPT language="JavaScript"><xsl:comment><![CDATA[

          function displayPage(from, to) {
            //Need to set the params to $to and $from
     source = new ActiveXObject("MSXM3.FreeThreaderDOMDocument");
            var s = document.XSLDocument.selectSingleNode("*/xsl:template
            var d = document.XMLDocument.selectSingleNode("Status/Data");
            Table.innerHTML = d.transformNode(document.XSLDocument);

          function sort(key) {
            var s = document.XSLDocument.selectNodes("*/xsl:template[@match
            for (var i = s.nextNode(); i != null; i = s.nextNode()){
                i.value = key;
            var d = document.XMLDocument.selectSingleNode("Status/Data");
            Table.innerHTML = d.transformNode(document.XSLDocument);


        <TABLE WIDTH="100%" BORDER="1" CELLSPACING="1">
        <TD colspan="3"><DIV id="Table">
                <!--<xsl:apply-templates select="Status/Data" order-by
                <xsl:apply-templates select="Status/Data"/>

<xsl:template match="Data">
  <xsl:variable name="from" select="1"/>
  <xsl:variable name="to" select="2"/>
  <xsl:call-template name="tableheader"/>
  <xsl:apply-templates select="//Uow[position() &gt;= $from and position()
  <xsl:call-template name="pagefooter"/>

<xsl:template name="tableheader">
        <th><A href="javascript:sort('senderId')">Sender ID</A></th>
        <th><A href="javascript:sort('docId')">Document Id</A></th>

<xsl:template name="pagefooter">
  <xsl:variable name="from" select="1"/>
  <xsl:variable name="to" select="2"/>
          <th><a href="javascript:displayPage({$from - 2}, {$from -
          <th><a href="javascript:displayPage({$to + 1}, {$to +

<xsl:template match="Uow">
        <td><xsl:value-of select="senderId"/></td><td><xsl:value-of select


Bharat Chintapally
CommerceQuest Inc.
New Phone # 813-639-6478

 XSL-List info and archive:

Current Thread