File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes XSL to display XML output in multiple pages Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XSL to display XML output in multiple pages" Watch "XSL to display XML output in multiple pages" New topic

XSL to display XML output in multiple pages

satya pandre

Joined: Oct 30, 2003
Posts: 3
I have 100 records in my XML.
I want to display 10 records in each page when I transform XML to HTML.
Is there anyway to do that in XSL ?
Lasse Koskela

Joined: Jan 23, 2002
Posts: 11962
Your display name, "satya", is in breach of our naming policy so I'll have to ask you to change it. We require both the first and the last name, although initials may be used in place of the first name.
Ah. I just noticed that Jason asked for the same in another thread. Sorry for the double-spam...
[ October 30, 2003: Message edited by: Lasse Koskela ]

Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Tony Yan
Ranch Hand

Joined: Apr 10, 2002
Posts: 170
I'd recommend the following.
(1) you can run position() function in a for-each node testing, and if the value falls in 1-10, that will be 1st page, 11-20, 2nd page, and so on.
(2) you can also insert some numbering attribute to the records from say 1 to 100. Then output only those fall in the right range for a given page.
(3) the best is to run xslt thru a subset of the XML records, probably at the DB end. This way, the performance is good. Imagine if you later have 10,000 records, grabbing 10 records out of them would be a very costly step.
(4) other inputs from ranchers?

Tony Yan<br /> <br />IBM Certified Developer XML and Related Technology<br />Sun Certified Web Component Developer For J2EE Platform<br />Sun Certified Programmer For Java 2 Platform
wood burning stoves
subject: XSL to display XML output in multiple pages
It's not a secret anymore!