OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

Subject: Re: [docbook-apps] help please. fo output, header and footer?

Hi Dave,

I just worked with this a few days ago. The header/footer system is
actually quite brilliant; at first I thought you could only have those
'left', 'right' and 'center' positions, but it turned out that the
header or footer is a table with an arbitrary (?) number of rows and
columns, with any names you want for the cells.

Chapter 13 of Bob Stayton's book (4th Ed) helped me get started, but
the description is a bit terse, so allow me to elaborate.

I'll just talk about the header to be brief, but the footer is
customized in the same way. So, just copy the templates header.content
and header.table from fo/pagesetup.xsl, and find a variable called
'candidate' in the header.table template. This is where you add
fo:table-row and fo:table-cell elements as required by your desired
header. In each fo:table-cell element you need to call the
'header.content' template and pass the desired cell in the 'position'

In my case, I wanted a header with four rows and three columns, but
with some cells empty. I called them r1c1, r1c2 etc., up to r4c3, but
could have called them 'companylogo', 'pagenumber' etc. Then I called
the header.content with each of those, passing the name in the
'position' parameter. All the template calls werewrapped in
fo:table-cell elements inside fo:table-rows.

In the 'header.content' template I added xsl:when elements with
test="$position = 'r1c1'" and so on, and inside those I then emit
text, fo:graphic elements, the page number etc. as appropriate. For
the empty cells the content of the appropriate xsl:when element is
just empty, and acts as a placeholder in case I want to put something
there later.

I won't copy and paste a lengthy XSL example, you'll surely figure it
out by looking at the templates from fo/pagesetup.xsl. The default
ones actually just happen to call the cells 'left', 'center' and
'right', and that confused me at first.

Hope this helps,

2007/10/11, Dave Pawson <davep@dpawson.co.uk>:
> I'm looking for an example of a header & footer specification
> for the customization layer, fo output.
> I'm using the v5 docbook, snapshot stylesheets.
> There seems to be no full example in the docs?
> Just the attribute sets that seem to be building a table?
> --
> Dave Pawson
> XSLT, XSL-FO and Docbook FAQ
> http://www.dpawson.co.uk
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
> For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]