This section covers just the first kind of header. By default, chunked HTML output gets a couple of lines of navigational links at the top and bottom of each output file. That permits the user to move from file to file to see all the content. If you don't chunk your HTML output, then there is no displayed header or footer in the file.

Adding extra lines

If you want to leave the navigational headers and footers in place, and just add something of your own, such as a copyright line, then you can fill in some no-op templates that are already called by the stylesheets. These are the header and footer templates in the order in which they are called on the page, including four that can be user defined:

Table 11.1. Templates for HTML headers and footers

Template name

When it is called

user.header.navigation

Called before standard navigational
header.

header.navigation

The standard navigational header.

user.header.content

Called after standard navigational header but
before any other content.

user.footer.content

Called after the chunk content but before the
standard navigational footer.

footer.navigation

The standard navigational footer.

user.footer.navigation

Called after the standard navigational
footer.

Inserting a copyright

Here is an example of adding a copyright statement to the bottom of each chunked file, above the standard navigational footer:

If you would rather have the copyright appear below the navigational footer, then use the user.footer.navigational template instead. The content of the template can include IMG elements to reference a graphical logo, and any other HTML content that makes sense. If you add classattributes, then you can control the formatting with your CSS stylesheet.

Inserting a CVS identifier

If your DocBook XML file is kept under a content management system such as CVS, you might want to insert the CVS version information on the HTML pages generated from the file. That informs the reader of when the content of the page was last changed.

The XSLT processor cannot directly request the version identifier from the CVS system. But that information can be stored in the XML document itself, where the stylesheet can access it. The trick is to put the CVS identifier string $Id​$ in a releaseinfo element in your document. It can go in the bookinfo element of a book, or the articleinfo element of an article. Each time the file is checked into the CVS system, the identifier string is updated by CVS with the latest information. For example:

The select attribute has an XPath expression that finds the first releaseinfo element in the document, and the xsl:value-of element takes its string value.

Navigational labels or graphics

The standard navigational headers and footers in chunked output use words such as Next, Prev, Up, and Home.

You can replace those words with different words by customizing the generated text. See the section “Customizing generated text” for a description of this method of customization. Here is an example that changes the word Home with Table of Contents for English output:

See the stylesheet file common/en.xml to see all the l:gentext elements with key names that begin with nav- that specify the navigational labels.

You can also replace the navigational words with graphical icons. See the section “Navigational icons” for the parameters to turn that feature on. You can also supply your own graphics.

Brief headers and footers

The standard navigational headers and footers also show the titles of the other files
by default. If you want a very clean presentation without the titles, then you can set the navig.showtitles parameter to zero (it is 1 by default). Then
you will see only Next and Prev or their icon equivalents.

Replace headers and footers

If you decide you need to completely replace the navigational headers and footers, then you can either create replacement templates, or you can turn them off and apply the user-defined templates instead.

If you want to retain the navigational features such as Next and Previous, then it is probably easiest to modify the existing templates. Copy the templates named header.navigation and footer.navigation from the html/chunk-common.xsl file to your customization layer for modification. You'll find they are substantial templates that create small tables to format the header and footer. They are passed two parameters named prev and next, which are the XML nodes for those pointers.

If your goal is to completely replace the standard headers and footers, then set the suppress.navigationparameter to 1 to turn them off. You can then
define
your own in templates named user.header.navigation and user.footer.navigation. If you don't define any new templates, then
you will
completely suppress headers and footers.