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

Subject: Re: [xsl] XSL-FO conditional pagination and content
From: Eliot Kimber <ekimber@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 26 Mar 2004 15:34:58 -0600
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
select="fo:page-number"/></xsl:variable>

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 www.cranesoftwrights.com.

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.

Cheers,

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

eliot@xxxxxxxxxxxxxxxxxxx
www.innodata-isogen.com

Current Thread