[xsl] Consecutive page numbering using XSL:FO-to-PDF

Subject: [xsl] Consecutive page numbering using XSL:FO-to-PDF
From: "Letitia and Drew Hodge" <ldhodge@xxxxxxxx>
Date: Tue, 31 Jul 2001 19:42:38 -0400
I have written an XSLT stylesheet that uses more than one <fo:page-sequence>
to create front matter, a TOC, and chapters in the target PDF document.  To
try and obtain consecutive page numbers that run from the first page of the
first chapter to the last page of the last chapter, I've used the
initial-page-number property, set to "auto", in each <fo:page-sequence>
element.  The result is a PDF document, nicely formatted into chapters with
left and right pages, that has each chapter's first page starting at 1.

For example:

I call the "static_content" template from within the <fo:page-sequence>
element ...

    <fo:page-sequence master-name="chapter"
        <xsl:call-template name="static_content" />
        <fo:flow flow-name="xsl-region-body">
            <xsl:apply-templates select="./section" />

and then, within the "static_content" template, I use <fo:page-number /> to
generate the page number ...

    <fo:static-content flow-name="odd_footer">
            <fo:table-column column-width="3.5in" />
            <fo:table-column column-width="2.5in" />
            <fo:table-column column-width="1.0in" />
            <fo:table-body font-family="sans-serif"
                       <fo:block text-align="start">
                           <xsl:value-of select="./sectionTitle" />
                        <fo:block text-align="end">
                            <fo:page-number />

Does anyone know what I'm doing wrong or how I can obtain sequential page
numbers when using more than one <fo:page-sequence>?

I'm using FOP version 0.19 for the FO-to-PDF conversion.


Drew Hodge
Technical Writer
(613) 270 3652

Securing the Internet

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

Current Thread