[Accessibility conventions are described at the bottom of the page]
*** This is a free preview excerpt of a commercial publication. ***

8. Flows, static content and page geometry sequencing
[> 9.][< 7.0][^^^]
8.0 Extended page model for pagination
[> 8.1][> 9.][< 8.][^^][^^^]
Bounded areas (pages) repeat to accommodate an arbitrary amount of content (flow)
[[1] - pagination differentiates XSL-FO semantics from web browser display semantics
]
[F1.0]Exactly one paginating flow is defined in XSL-FO 1.0
[[1] - an implicit flow map corresponds flow names to region names
 [1] - only serpentine flow is through equal-width evenly-spaced columns
]
[F1.1]One or more paginating flows can be defined in XSL-FO 1.1
[[1] - a stylesheet-defined flow map arbitrarily corresponds flow names to region names for desired effects
 [1] - the same 1.0 implicit flow map corresponds flow names to region names when the stylesheet does not provide an explicit flow map
 [1] - multiple body regions allow the stylesheet to place many regions arbitrarily on the page
]
[Figure 8.1: Multiple flows in XSL-FO 1.1
Four pairs of pages are shown with the following titles on the pairs:
[[1] - One flow - one region
[[2] - there is one region on each page and one serpentine path of one flow leading from the bottom of the left page to the top of the right page
][1] - Two flows- one region
[[2] - there is one region on each page and one serpentine path of two consecutive flows leading from the bottom of the left page to the top of the right page
][1] - Two flows - two regions
[[2] - there are two regions on each page and two serpentine paths, one each of two different flows, the left path leading from the bottom of the left region of the left page to the top of the left region on the right page, and the right path leading from the bottom of the right region on the left page to the top of the right region on the right page
][1] - One flow - two regions
[[2] - there are two regions on each page and one serpentine path leading from the bottom of the right region on the left page to the left region on the left page to the right region of the right page to the left region on the left page (as a kind of "backwards columns" presentation")
]]
]
The pages in the collection need navigational aids repeated on each page
[[1] - used to understand a page's role when not in the context of neighboring pages
 [1] - page numbers and page number citations
[[2] - a focus on the specific bounded area of a piece of information
 [2] - used on the given page for navigation
 [2] - used on other pages for citations to the given page
[[3] - e.g. cross references
 [3] - e.g. index information
]][1] - headers and footers
[[2] - contextual information about a collection of pages in which the page is found
 [2] - e.g. chapter title repeated in the header
][1] - cited information found from the page being formatted can be contextual information
[[2] - information that would not be known about a page by the stylesheet at the time of transformation, possibly changing for each page generated
[[3] - the act of pagination dictates the page boundaries, not the transformation of the source information
][2] - e.g. dictionary headers (finding one of many items on a page)
 [2] - e.g. subsection citations (finding breaks not triggering new pages)
]]
Every page sequence starts a new page and has its own definitions for static content
[[1] - all candidate uses of static content must be defined for each page sequence
 [1] - necessary for the stylesheet writer to repeat the definitions in each page sequence if the same behavior is desired
 [1] - every page sequence begins on a new page
[[2] - changing a header or footer in the middle of a page sequence requires manipulating the dynamic content that can be placed within static content
]]
Static content and paginated flow are associated with a region's name, not position
[[1] - association of the flow name through the flow map to the region name
 [1] - must organize the desired region names in each page geometry
 [1] - must bind in each page sequence the static content and flows for named regions
 [1] - all flows are used for only the named regions found on each page geometry used
[[2] - it is not an error to supply static content or flow for a region that isn't used
][1] - static content can be supplied for named sub-regions triggered by the formatter
]
Differences in page geometry are allowed when more than one page being rendered
[[1] - supports tests for differences to be performed within each page sequence construct's flow when the flow triggers the need for a new page
 [1] - different named geometries can be identical to others or have differences such as:
[[2] - the change of physical dimensions
 [2] - the choice of region dimensions and names
 [2] - the change of margins
 [2] - the presence of headers and/or footers
 [2] - the count of columns
 [2] - the orientation of regions
 [2] - the backgrounds of regions
 [2] - the absence of flowed content (to utilize an entire page of static content)
]]
Can describe a sequence with odd and even page number parity differences
[[1] - e.g. alternating headers and footers
 [1] - two different static contents are defined with the page number to be rendered on the outside edge of each side of a bound publication
[[2] - differences in headers and footers of the geometries alternate the names of the flows for the static content between odd and even numbered pages
]]
Can describe a sequence with first, last, and middle page differences
[[1] - to utilize differences based on where a given formatted page is within its containing page sequence
 [1] - e.g. no heading on the first page of a chapter sequence
]
Can describe a sequence to replace absent content for forced un-flowed blank pages
[[1] - to accommodate a requirement for a specified parity of pages in a given sequence, or the need for the subsequent page sequence to start on a page following the page after the end of a page sequence's flow
 [1] - i.e. "this page intentionally left blank"
 [1] - by definition, a forced page is made up entirely of static content
]
Each page sequence points to a defined sequence of page geometries
[[1] - the stylesheet writer choreographs the page geometries by the anticipated needs for the quantity of flow expected to be formatted
 [1] - all static content definitions needed for a page sequence must be present in that sequence
[[2] - often requires stylesheet writing techniques that copy information repeatedly
]]
Consider the choreography in each of two possible page plans for a TOC and chapters:
[[1] - a single-sided presentation on the left with all page sequences consecutive:
[[2] - document title centered at the top of document content pages (but not the TOC)
 [2] - page number and total page count centered at the bottom of all pages
][1] - a double-sided presentation on the right with contents starting on right-hand page:
[[2] - requires the table of contents to be an even number of pages
 [2] - document title at bottom left of odd pages and bottom right of even pages
 [2] - chapter title at top right of odd pages and top left of even pages
 [2] - page number and total page count centered at the bottom of all pages
]]
[Figure 8.2: Page sequence and static content planning
Two candidate page sequences are shown as described in the text.
]
The XSL-FO objects covered in this chapter are summarized as follows.
Formatting objects related to static content:
[[1] - <[region-before]> ([6.4.15])
[[2] - the definition of the body region perimeter area whose before-edge is co-incident with the before-edge of the page's content rectangle
[[3] - in lr-tb mode this is the header at the top of the page
]][1] - <[region-after]> ([6.4.16])
[[2] - the definition of the body region perimeter area whose after-edge is co-incident with the after-edge of the page's content rectangle
[[3] - in lr-tb mode this is the footer at the bottom of the page
]][1] - <[region-start]> ([6.4.17])
[[2] - the definition of the body region perimeter area whose start-edge is co-incident with the start-edge of the page's content rectangle
[[3] - in lr-tb mode this is the sidebar at the left of the page
]][1] - <[region-end]> ([6.4.18])
[[2] - the definition of the body region perimeter area whose end-edge is co-incident with the end-edge of the page's content rectangle
[[3] - in lr-tb mode this is the sidebar at the right of the page
]][1] - <[static-content]> ([6.4.20])
[[2] - the definition of content that is primarily unchanged from page to page in a page sequence
[[3] - entire sequence is repeated on each page except for page numbers and user-defined markers
]][1] - <[page-number]> ([6.6.10])
[[2] - an inline-level place holder replaced with the page number of the current page
][1] - [F1.1]<[folio-prefix]> ([6.6.13])
[[2] - a sequence of text defined to prefix page numbers of a page sequence
][1] - [F1.1]<[folio-suffix]> ([6.6.14])
[[2] - a sequence of text defined to suffix page numbers of a page sequence
][1] - <[retrieve-marker]> ([6.13.6])
[[2] - an inline-level place holder for perimeter regions, replaced with the formatting objects of the indicated marker
][1] - [F1.1]<[retrieve-table-marker]> ([6.13.7])
[[2] - an inline-level place holder for tables, replaced with the formatting objects of the indicated marker
][1] - <[marker]> ([6.13.5])
[[2] - the replacement formatting object content for a marker retrieved in static content
]]
Formatting objects related to page geometry sequencing:
[[1] - <[page-sequence-master]> ([6.4.8])
[[2] - the definition and name of a particular sequence of using page-masters
][1] - <[single-page-master-reference]> ([6.4.9])
[[2] - the specification of the single use of a page-master within a sequence of page-masters
][1] - <[repeatable-page-master-reference]> ([6.4.10])
[[2] - the specification of the repeated use of a page-master within a sequence of page-masters
][1] - <[repeatable-page-master-alternatives]> ([6.4.11])
[[2] - the collection of possible page-master references from which one is to be used based on status conditions detected by the formatter
][1] - <[conditional-page-master-reference]> ([6.4.12])
[[2] - a page-master choice available to the formatter when selecting from a collection of candidate page-masters
]]
Formatting objects related to flow maps:
[[1] - [F1.1]<[flow-map]> ([6.4.22])
[[2] - specifies a collection of assignments of a set of named flows to a set of named regions
][1] - [F1.1]<[flow-assignment]> ([6.4.23])
[[2] - specifies a single assignment of a set of named flows to a set of named regions
][1] - [F1.1]<[flow-source-list]> ([6.4.24])
[[2] - specifies a set of named flows in a single flow assignment
][1] - [F1.1]<[flow-name-specifier]> ([6.4.25])
[[2] - specifies a single named flow in a set of named flows
][1] - [F1.1]<[flow-target-list]> ([6.4.26])
[[2] - specifies a set of named regions in a single flow assignment
][1] - [F1.1]<[region-name-specifier]> ([6.4.27])
[[2] - specifies a single named region in a set of named regions
]]
8.1 Page Sequence Master Interleave (PSMI)
[> 9.][< 8.0][^^][^^^]
8.1.1 Changing the page geometry based on authored content
[> 9.][< 8.0][^^][^^^]
Sometimes it is necessary to change page geometry based on content
[[1] - the XML source author may arbitrarily request a change in the page geometry
 [1] - consider the need to change the geometry for a lengthy landscaped table
[[2] - cannot use a rotated table because the table length is limited by the container
 [2] - must switch to a landscape body region so the lengthy table flows to subsequent pages
][1] - consider the need to flow certain figures into double-sized pages
[[2] - must selectively choose a geometry with the different dimensions
][1] - the construct may be deep within the structure of the document being processed
]
To use XSL-FO one must package all content for each page geometry for the flow of a page sequence
[[1] - this can involve a difficult and wasteful recursive process
[[2] - finding all information up to the change in geometry
 [2] - package the information up in a page sequence
 [2] - package up the special constructs in a different page sequence
 [2] - recursively find all information up to the next change in geometry
][1] - this breaks the XSLT model of hierarchical processing
[[2] - susceptible to development and maintenance problems
]]
A two-step process can make this very easy to implement
[[1] - the first step creates the flow with supplemental indications of the need to change geometries
[[2] - can come from any depth of processing of the source document
 [2] - block level constructs of a page are the immediate children of the flow
][1] - the second step repackages flow children in as many sequences as necessary
[[2] - recursively checks all flow child constructs for any changes in geometry
 [2] - not necessary to check any depth deeper than the children
][1] - the resulting document is then processed by a standard XSL-FO engine
]
The Page Sequence Master Interleave (PSMI) semantic implements this algorithm
[[1] - public resource freely available from Crane Softwrights Ltd.
[[2] - [http://www.CraneSoftwrights.com/links/res-pfux.htm]
][1] - one-element vocabulary designed to express the semantic of this two-step intermediate process
 [1] - an XSLT stylesheet to implement the semantic for any XSL-FO+PSMI sequence
]
Consider the need to flow a landscape table in a portrait page geometry
[[1] - could rotate a short table in a block container to present in landscape
[[2] - a long table would overflow and not trigger a new page in pagination
][1] - using PSMI one could flow the landscape table into an interleaved page geometry where the body region of that geometry is landscape
 [1] - the PSMI stylesheet reads the XSL-FO+PSMI instance and produces a pure XSL-FO instance where three page sequences are created where one was before
 [1] - a long table in the landscape body region will correctly trigger new pages in pagination
]
[Figure 8.3: Page Sequence Master Interleave (PSMI)
A page sequence in portrait orientation is shown with blocks on the first page, a block container on the middle page, and blocks on the third page. The block container is rotated with the top being on the left. A table in the block container is longer than will fit on the page, and an overflow condition exists with only that portion of the table that fits being visible.
The second page sequence shows a PSMI page sequence containing the table instead of the block container. The PSMI page sequence points to a landscaped page geometry.
The third page sequence shows the result of processing the second page sequence through the PSMI stylesheet. Three page sequences are created from the one with the table construct flowed inside of the landscaped page geometry. Those constructs outside the PSMI construct of the second page sequence are still in portrait orientation.
]
The end result of PSMI transformation is a pure XSL-FO instance:
[[1] - the parent XSL-FO page-sequence of the PSMI page-sequence is split
 [1] - a new XSL-FO page-sequence is created for the PSMI page-sequence and contains its blocks
 [1] - the preceding siblings of the PSMI page-sequence are put in the preceding page sequence
 [1] - the following siblings of the PSMI page-sequence are put in the following page sequence
 [1] - the process accommodates any number of PSMI children of an XSL-FO page-sequence
]
[Figure 8.4: Block nesting when using PSMI
A pair of nested block diagrams is shown, where child elements are smaller boxes shown inside larger parent boxes.
The boxes on the left show the PSMI page sequence nested at the top of the flow in an XSL-FO page sequence.
The boxes on the right show only XSL-FO page sequences, where the old XSL-FO page sequence has been split into two new page sequences, one before the XSL-FO page sequence generated from the PSMI page sequence, and one after.
]
The two-step process involves:
[[1] - the user's stylesheet to produce the XSL-FO+PSMI intermediate sequence
 [1] - the PSMI stylesheet to produce a pure XSL-FO instance
]
[Figure 8.5: PSMI Use With XSLT
A flow diagram shows the user's transformation script and source document being processed by XSLT to produce an XSL-FO+PSMI intermediate document. This document is then processed by XSLT with the PSMI stylesheet to produce a pure XSL-FO instance. The pure XSL-FO instance can then be processed by any conforming XSL-FO engine.
]
[Example 8-1: PSMI constructs in example An example of flow implementing the change in page geometry:
01      <simple-page-master master-name="frame-portraitbody" ...>
02   <region-body region-name="frame-body" .../>
03   <region-before region-name="frame-before" .../>
04   <region-after region-name="frame-after" .../>
05   </simple-page-master>
06   <simple-page-master master-name="frame-landbody" ...>
07   <region-body region-name="frame-body"
08   reference-orientation="90" .../>
09   <region-before region-name="frame-before" .../>
10   <region-after region-name="frame-after" .../>
11   </simple-page-master>
12  ...
13  <page-sequence master-reference="frame-portraitbody">
14   <flow flow-name="frame-body">
15   <block>Portrait information</block>
16   ...
17   <block>Next is landscaped</block>
18   <psmi:page-sequence master-reference="frame-landbody"
19   xmlns:psmi="http://www.CraneSoftwrights.com/resources/psmi">
20   <flow flow-name="frame-body">
21   <table>
22   <table-body>
23   <table-row>
24   <table-cell border="solid">
25   <block>This is a test</block>
26   <block>This is a test</block>
27   ...
28   <block>This is a test</block>
29   <block>This is a test</block>
30   </table-cell>
31   </table-row>
32   </table-body>
33   </table>
34   </flow>
35   </psmi:page-sequence>
36   <block>Back to portrait</block>
37   ...
38   </flow>
]

*** This is a free preview excerpt of a commercial publication. ***

This is an accessible version of Crane's commercial training material. The content has been specifically designed to assist screen reader software in viewing the entire textual content. Figures are replaced with text narratives.

Navigation hints are in square brackets:
[Tx.x] and [Fx.x] are textual representations of the applicability icons;
[digit] indicates list depth for nested lists;
[link [URL]] indicates the URL of a hyperlink if different than link;
[EXAMPLE] indicates an example listing of code;
[FIGURE] indicates the presence of a figure replaced by its description;
[>] jumps forward;
[<] jumps backward;
[^] jumps to start of the section;
[^^] jumps to the start of the chapter;
[^^^] jumps to the table of contents.
Suggestions for improvement are welcome: [info@CraneSoftwrights.com]
Book sales: [http://www.CraneSoftwrights.com/links/trn-acc.htm]
Information: [http://www.CraneSoftwrights.com/links/info-acc.htm]
This content is protected by copyright and, as there are no means to protect this accessible version from plagiarism, please do not make any commercial edition available to others.

+//ISBN 978-1-894049::CSL::Courses::PFUX//DOCUMENT Practical Formatting Using XSL-FO 2008-01-27 17:30UTC//EN
Practical Formatting Using XSL-FO
Seventh Edition - 2008-01-27
ISBN 978-1-894049-19-1
Copyright © Crane Softwrights Ltd.