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

Re: Paging using XSLT

Subject: Re: Paging using XSLT
From: "Steve Muench" <Steve.Muench@xxxxxxxxxx>
Date: Fri, 3 Nov 2000 13:21:13 -0400 (EST)
xsl paging product
| >in their stylesheet to "filter" the data to emit
| >only rows N through M of those 25000 onto the browser.
| >(Where M-N is usually in the 10-15 range).
| </Steve>
| 
| How did they do this? I am trying to do the same, but I do not have
| so many records. I am already using a bunch of filters to reduce the
| amount of data.

This topic is getting a little off the XSLT track for
this list, but as a final posting, I'll note that
the way with Oracle to achieve this is to use
the "TOP-N" query feature in Oracle8i.

If you are ordering your data by a value that
makes each row distinct (e.g. the primary key
or any other unique key), then to retrieve
the "next 10" rows after a certain key that
was "last" on the current page, you can do:

SELECT userid, firstname, lastname, phone
  FROM ( SELECT userid, firstname, lastname, phone
           FROM all_emps
          WHERE lastname like '%JONES%'  /* This was the orig query critera */
           AND  userid > 'abjones'       /* Return matches beyond 'abjones' */
        ORDER BY userid                  /* Order the inner query by userid */
       )
  WHERE ROWNUM <= 10  /* Get the "top-10", i.e. first 10, rows */

I cover this topic of stateless paging in my book on pages 643-655.

| The "big" advantage I get by paging and sorting at the browser(/client)
| end is that I do not have to hit the web_server/db_server again for the
| same (sorted/paged) data.If I have to save some db hits, I may have to
| cache the data using sessions.

The tradeoff depends on the probability that the users
will visit all of the rows. If the user is likely to 
visit all the rows, then one big hit is probably better
and browser-side XSLT can be helpful.

If the user is likely to conclude after paging through
a couple of pages that they *should* have refined their
query criteria a little better (imagine a Google.com
search where you typically don't go beyond the first
couple of pages of "most relevant" hits), then downloading
all the hits might be a bad idea. Depends on the app.

______________________________________________________________
Steve Muench, Lead XML Evangelist & Consulting Product Manager
BC4J & XSQL Servlet Development Teams, Oracle Rep to XSL WG
Author "Building Oracle XML Applications", O'Reilly
http://www.oreilly.com/catalog/orxmlapp/





 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.