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

xslt transform sql into html tables for dhtml paging

Subject: xslt transform sql into html tables for dhtml paging
From: "Kovach, Dave" <dave.kovach@xxxxxxx>
Date: Thu, 24 Jan 2002 01:45:15 +0100
dhtml paging
Hello all,

I am bringing back sql records as an xml document... each record
is a node element...

	<rec field="" field="" field= ...etc...>

My goal is to implement "paging" using XSLT... and using CSS and DHTML to
hide and unhide
tables built from the xml depending on which Page link is clicked... xslt is
on the server... transforming the data etc. into html tables and then using
the client to change the CSS visibility of each table/hiding the others. 
So its pure HTML to the client.

So on the server, the problem is after getting the nodeset how to determine
how many 
tables to build and then add in the rows per table... and use the FOR...EACH
statement to do this??? I sorta end up with nested FOR...EACH's and then
cant figure
how to go back to the outer FOR...EACH to build the next table.. with the
next set
of data that would comprise that table...

I would set an arbitrary variable to define how many records (xml nodes) to 
display "per page"... So, say I set:

recPerTable = 4

And then iterate over the nodeset... to have 2 tables (8 rec's above divided
by recPerTable = 2) built that then will have 2 links:


And clicking page1 will show table 1 and hides table 2
and clicking page2 will show table 2 and hide table 1 you
get the idea.

Reason for doing this is... I am bringing back the sql records in one 
fell swoop and dont need to go back to the server. I have the DHTML etc.
all built and use it for other things similar to this... my problem
is trying to use the FOR...EACH XSLT statement and not use it thinking
like a "procedural language" programmer...

XSLT problem is:

1. Need to build (per example above) 2 tables... then
2. Need to grab the first 4 nodes of <rs> and place them in first table
3. Need to grab the last 4 nodes of <rs> and place them in second table

How might you accomplish this? Any ideas? Thoughts or better ways to 

Thank you for your ideas and input,


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

Current Thread


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.
First Name
Last Name
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.