[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Pageing

Subject: RE: Pageing
From: "Passin, Tom" <tpassin@xxxxxxxxxxxx>
Date: Wed, 7 Jul 2004 15:45:41 -0400
pageing
> From: Evan Wellens [mailto:evanw@xxxxxxxxxxxxxxxxxxxx]
> 
>          Does anyone know any tricks to pull off paging without
involving
> server interaction. Our XML & XSL must be portable and transform
without
> server interaction. I know I can filter by record count with something
> like
> 
> <xsl:if test="position() &lt; 17">
> 

I presume that you want to display a series of records from a database
query?

> But this type of static processing will not allow for things such as
next
> and previous page links ( at least I don't believe so) . 

Why not?  There are various ways you can go, depending on just what kind
of data you plan to send and whether you can dynamically do xslt
transformations in the browser (which you can with IE and also, I think,
with Mozilla).


A) The simplest thing to do is to fake the paging - put all the data on
a single page, but space each successive block of records so far down
that it isn't visible when the previous block is on the screen.  Your
stylesheet would insert hyperlinks for previous and next "pages".  I
have done this with presentations.  To a user, it looks like you are
bringing in a new page, but really you are just navigating to a
different part of the same one.  This approach does not require dynamic
xslt transformations, just one on page load, and it could be done at the
server.

B) If you can do dynamic transformations, you can feed the stylesheet a
parameter that says which records to include on a page, and again the
stylesheet would create the hyperlinks.  This time, the hyperlinks would
probably point to javascript code to run the corresponding
transformations.

C) Somewhat more painful but very still feasible is to have the
stylesheet create javascript data structures that contain all the data.
When the user pages, you would rewrite the display block (preferably a
"div" element") using a javascript function.  This approach is also very
feasible.  Again, the transformation could even be done on the server
before sending the page to the browser.

I have done A) and C) myself with good success.

Cheers,

Tom P


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.