XSL-FO Tutorials - Herong's Tutorial Examples - v2.24, by Herong Yang
Wheat Is "repeatable-page-master-alternatives"?
This section describes 'repeatable-page-master-alternatives' which is a sub element of 'page-sequence-master' to declare a sub sequence of layouts by specifying a list of alternative layouts with a condition attached to each layouts.
Of the three sub elements of "page-sequence-master", the first two: "single-page-master-reference" and "repeatable-page-master-reference" are easier to understand. The third one, "repeatable-page-master-alternatives", requires more attention.
Wheat Is "repeatable-page-master-alternatives"? - "repeatable-page-master-alternatives" is sub element of "page-sequence-master". It is used to declare a sub sequence of layouts by specifying a list of alternative layouts with a condition attached to each layouts. When a page is mapped to "repeatable-page-master-alternatives", the first layout that satisfies the condition will be selected to generate the page.
"repeatable-page-master-alternatives" has one attribute and repeatable sub elements:
"conditional-page-master-reference" has these attributes:
Here is an example of "page-sequence-master" to illustrate how to "repeatable-page-master-alternatives" sub elements:
<fo:page-sequence-master master-name="chapter"> <fo:repeatable-page-master-alternatives maximum-repeats="no-limit"> <fo:conditional-page-master-reference master-reference="odd_first" odd-or-even="odd" page-position="first"/> <fo:conditional-page-master-reference master-reference="even_first" odd-or-even="even" page-position="first"/> <fo:conditional-page-master-reference master-reference="odd_other" odd-or-even="odd" page-position="rest"/> <fo:conditional-page-master-reference master-reference="even_other" odd-or-even="even" page-position="rest"/> </fo:repeatable-page-master-alternatives> </fo:page-sequence-master>
The above layout sequence can be applied to a "page-sequence" to generate a single chapter of a book. If the first page of the chapter is an odd page, "odd_first" layout applies. If the first page of the chapter is an even page, "even_first" layout applies. For other odd pages, "odd_other" layout applies. For other even pages, "even_other" layout applies.
Table of Contents
Apache™ FOP (Formatting Objects Processor)
XSL-FO Document Basics and Examples
simple-page-master - Simple Page Layout
simple-page-master Attributes and Sub Elements
simple-page-master/region-body Sub Element
region-before and region-after Sub Elements
region-start and region-end Sub Elements
"Body" Region Margin and "Side" Region Extent
Precedence of Side Region Corners
Page Layout and Page Sequence Mapping
What Is "page-sequence-master"
Layout Sequence Example - Cover and Content
►Wheat Is "repeatable-page-master-alternatives"?
Layout Sequence Example - Odd and Even Pages
Block-Level Formatting Objects
Inline-Level Formatting Objects
Including Graphics in XSL-FO document
Floating Blocks - "float" and "footnote"
Hyperlinks, Table of Contents and Indexes
Headers and Footers using "static-content"
Font Attributes and Font Families
Apache FOP Font Configurations