Altova Mailing List Archives

Re: [xsl] XSL-FO conditional pagination and content

From: Eliot Kimber <ekimber@------------------->
Date: 3/26/2004 11:37:00 AM
M. David Peterson wrote:

<fo:page-number/> will do nothing for you as far as putting its value
into your variable for testing.  Replace it with <xsl:value-of
select="fo:page-number"/> and see where that gets you.

<xsl:variable name="pgNumber"><xsl:value-of

That won't work either.

You can't get the page number value during XSLT processing because the 
FO instance you're generating hasn't been paginated yet.

You can almost certainly solve your problem with more sophisticated page 
masters and page sequences.

The only way to solve this type of problem is to do some sort of 
two-pass process where you paginate the document once and then feed the 
page numbers back into the XSLT process. There is no standard for doing 
this nor do I know of anyone whose actually implemented it for this type 
of processing.

However, the mechanism Ken Holman has developed for producing 
back-of-the-book indexes can probably be extended to support this 
requirement. See his Web site at

I have proposed in several venues an FO extension that would allow you 
to generate "side files" during FO processing so you could, for example, 
capture the page number that a given original input element fell on, but 
so far no-one has implemented it.


W. Eliot Kimber
Professional Services
Innodata Isogen
9030 Research Blvd, #410
Austin, TX 78758
(512) 372-8122



These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.