Re: [xsl] xsl help adding a footer with page number

Subject: Re: [xsl] xsl help adding a footer with page number
From: JBryant@xxxxxxxxx
Date: Fri, 8 Apr 2005 14:36:53 -0500
Hi, Josh,

Here's a simplified version of one of my page definitions:

<fo:simple-page-master master-name="main" 
  <fo:region-body region-name="main" margin-top="1in" 
  <fo:region-before region-name="header-main" extent="1in"/>
  <fo:region-after region-name="footer-main" extent="1in"/>

Note that the regions have names.

And here's the corresponding flow definition (much simplified, of course):

<fo:page-sequence master-reference="main">
  <fo:static-content flow-name="header-main">
    <fo:block xsl:use-attribute-sets="header">
      <fo:external-graphic src="logo.gif"/>
  <fo:static-content flow-name="footer-main">
    <fo:block xsl:use-attribute-sets="footer">
  <fo:flow flow-name="main">
    <!-- Build the document here -->

The static-content chunks flow into the before and after regions, and the 
main flow goes in the usual flow area. In this fashion, you can build a 
series of different page definitions. I generally use front (for the title 
page and copyright notices and such), contents (for the table of 
contents), main (for the body of the book), and back (for the appendixes, 
glossary, and index). So most of my book definition FO files have 4 page 
masters and 4 corresponding page-sequence objects, each with 
static-content ojbects (that match the regions defined in the page 
masters) for the headers and footers.

Let me know if you need more explanation. Also, you FOP distribution has 
several examples to examine.

Jay Bryant
Bryant Communication Services
(presently consulting at Synergistic Solution Technologies)

josh higgins <doopsterus@xxxxxxxxx> 
04/08/2005 02:17 PM
Please respond to

xsl <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>

[xsl] xsl help adding a footer with page number

I have the following template specified and I was
trying to add a custom footer to this document.  I am
using FO and not html.  All I want in the footer is
the page number followed by the word "CURRENT".  How
can I do this? 

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"

 <xsl:template match="/">
     <fo:simple-page-master master-name="simple"
     <fo:region-body margin-top=".5in"/>
       <fo:region-before extent=".5in"/>
       <fo:region-after extent=".5in"/>
   <fo:page-sequence master-reference="simple">
                 <fo:flow flow-name="xsl-region-body">
                                 <!-- I have fo:blocks displayed items 
here -->

Do you Yahoo!? 
Yahoo! Personals - Better first dates. More second dates.

Current Thread