[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
Hello all, I am bringing back sql records as an xml document... each record is a node element... <rs> <rec field="" field="" field= ...etc...> <rec..> <rec..> <rec..> <rec..> <rec..> <rec..> <rec..> </rs> 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 happening on the server... transforming the data etc. into html tables and then using DHTML on 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 xslt 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: Page1 Page2 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 approach? Thank you for your ideas and input, David XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|