W3C home > Mailing lists > Public > www-xsl-fo@w3.org > September 2001

Re: XSL:FO Total Page count

From: G. Ken Holman <gkholman@cranesoftwrights.com>
Date: Wed, 05 Sep 2001 14:22:54 -0400
Message-Id: <>
To: www-xsl-fo@w3.org
At 01/08/31 19:02 +0100, Dave Pawson wrote:
>At 13:26 30/08/2001 -0400, Jay Balunas wrote:
>>      Is there a way to get the total number of pages in a document.  I need
>>to display the old "#cur. of #total" display.  I got the <fo:page-number>
>>easy enough but I can't find anything on this.

I think I've proven in an earlier post that this doesn't work in the 
general case, though it does work in the simple case.

The suggestion in the FAQ is:

last page citation:  <fo:page-number-citation ref-id="endofdoc"/>
last page referent: <fo block id="endofdoc">

However, should the last page have a number of floats that spill on to the 
next page, then the referent is not on the last page.

So, one might think to put the last page referent at the end in a float so 
that it stacks after any other floats that might on the last page and, when 
pushed off the last page of blocks, the referent is on the last page with 
the floats.

But ... if there are no floats on the last page (and you don't know if 
there are or there aren't), the act of adding a float with the referent 
block triggers the generation of the xsl-before-float-separator sub-region 
and if you have a definition for xsl-before-float-separator, that appears 
on the page but without any apparent float because the referent is empty.

If I don't have any other floats on the last page, I certainly don't want 
the xsl-before-float-separator showing up.

Looking at PR, I don't see this conundrum has been addressed.  I think it 
needs an explicit property so the formatter decides what the last page is, 
not the stylesheet writer.

...................... Ken

Training Blitz: 3-days XSLT/XPath, 2-days XSLFO in Ottawa 2001-10-01/05

G. Ken Holman                      mailto:gkholman@CraneSoftwrights.com
Crane Softwrights Ltd.               http://www.CraneSoftwrights.com/f/
Box 266, Kars, Ontario CANADA K0A-2E0     +1(613)489-0999   (Fax:-0995)
Web site:     XSL/XML/DSSSL/SGML/OmniMark services, training, products.
Book:  Practical Transformation Using XSLT and XPath ISBN 1-894049-06-3
Article: What is XSLT? http://www.xml.com/pub/2000/08/holman/index.html
Next public instructor-led training:      2001-09-18,09-19,10-01,10-04,
-                                         10-22,11-05,12-09,12-10,02-02
Received on Wednesday, 5 September 2001 14:23:37 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:58:25 UTC