Re: page numbers and fo

Subject: Re: page numbers and fo
From: "Nikolai Grigoriev" <grig@xxxxxxx>
Date: Mon, 5 Jun 2000 16:11:43 +0400
> Is there any chance to get that going with XEP ? Ok, there are wonderful
> examples on the RenderX site, but these are the real life requirements ...

Unfortunately, no: XEP in its current version still supports only the Apr99 XSL
FO WD, that made no provision to control page sequences conditionally. The best
thing we can do now is having no number on the first page, and all other pages
numbered (as Sebastian wrote).

To solve your particular problem in a hackerish way, you can try to switch
stylesheets. I mean that you prepare two separate stylesheets - one without page
numbers, one having page numbers. You first format you document using a
stylesheet with page numbers, and process the resulting FO by XEP, FOP or
PassiveTeX. If the result has only one page, you re-run your XSLT processor and
generate another version of your document, with unnumbered pages. The overhead
will consist in formatting one-page documents twice - not quite nice, but
probably toleratable.

Being native-mode formatters, FOP and XEP let you know how many pages have been
output (just grasp the progress messages ;-)).

Regards,
Nikolai Grigoriev
RenderX

P.S. In the last WD, ths can be achieved: you define a page master for a
single-paged document (say, "the-only-page"), and then insert it into a
fo:page-sequence-master this way:

<fo:page-sequence-master name="page-switching-example">
  <fo:repeatable-page-master-alternatives>
    <fo:conditional-page-master-reference
            master-name="the-only-page"
            page-position="last" />
  </fo:repeatable-page-master-alternatives>

  ... (here, you put a regular sequence for more-that-one-page documents) ...

<fo:page-sequence-master>

This works, because:
- if there is only one page in the document, than the
'page-position="last"'condition holds true, and "the-only-page" master will be
selected for processing;
- if there are two or more pages, then nothing can be selected from the first
fo:repeatable-page-master-alternatives to process the first page, and the page
sequence continues from the next sub-sequence in the fo:page-sequence-master.

I really hope we can support the last draft quite soon ;-).






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


Current Thread