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

RE: counter

Subject: RE: counter
From: Jeni Tennison <Jeni.Tennison@xxxxxxxxxxxxxxxx>
Date: Tue, 20 Jun 2000 19:10:22 +0100
RE: counter
Dave,

>I'm trying to split a huge table of items into several pages.  I'd like to
>have a page header, the 50 items, then a page footer consisting of the
>current page and total number of pages, followed by the next page of items,
>with it's own header and footer.

As long as it's as simple as this, you could count the total number of
items, divide by 50 and 'ceiling' the result to get the number of pages.
If your 'item' elements were all within a 'list', for example:

<xsl:template match="list">
  Number of pages: <xsl:value-of select="ceiling(count(item) div 50)" />
</xsl:template>

>Would the XML document have to be parsed twice to obtain the total number of
>pages?

The XML document doesn't have to be parsed twice, but you might have to
process the output of your page-creating stylesheet with a page-numbering
stylesheet (say) if you can't work out the number of pages that there are
going to be a priori from the original XML document that you have.  If your
algorithm for creating pages is fairly simple, as above, then you there's
no need.

I hope that helps,

Jeni

Dr Jeni Tennison
Epistemics Ltd, Strelley Hall, Nottingham, NG8 6PE
Telephone 0115 9061301 ? Fax 0115 9061304 ? Email
jeni.tennison@xxxxxxxxxxxxxxxx



 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.