Chapter 10. Putting It All Together

A small, complete document uses much of the previously described functionality and illustrates the power of XSL-FO.

Outline

As source content, I’m going to use an imaginary book outline. In terms of layout, the major elements are the front matter, which requires attention and is a one-off; the main chapters, which share layout but have one or two special treatment areas; and the rear matter, for which separate treatment is needed for an index.

The pagination needed is shown in Figures Figure 10-1 and Figure 10-2.

Frontmatter layout

Figure 10-1. Frontmatter layout

Initial page layout

Figure 10-2. Initial page layout

No page headers are needed for the first three pages, page numbers are needed only for the preface and table of contents, then we use a header (no footer), as shown, for the remainder of the chapters. Now we can specify these and define some of the attribute sets that will be used throughout.

So let’s put an outline together. I’m presuming a fairly complex stylesheet, so I’ll partition it early. The main stylesheet will hold only the content templates and will import separate stylesheets for the page layout (layout master set), the primary element templates. I’ll start with a trial for the layout master set.

First, separate simple-page-master s will be needed for the ...

Get XSL-FO now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.