[Accessibility conventions are described at the bottom of the page]

Practical Formatting Using XSL-FO

Table of Contents
1. Introducing XSL-FO
1.1 Fine-grained control of layout nuances
1.1.1 Fine-grained control of layout nuances
1.2 The many existing deployments of XSL-FO
1.2.1 The many existing deployments of XSL-FO
2. The context of XSL-FO
2.1 The XML family of Recommendations
2.1.1 Extensible Markup Language (XML)
2.1.2 XML information links
2.1.3 Document Style Semantics and Specification Language (DSSSL)
2.1.4 Cascading Stylesheets (CSS)
2.1.5 Styling structured information
2.1.6 Extensible Stylesheet Language Transformations (XSLT)
2.1.7 Extensible Stylesheet Language (XSL/XSL-FO)
2.1.8 Styling semantics and vocabularies
2.1.9 Outboard XSLT and XSL-FO processes
2.1.10 Transforming and rendering XML information using XSLT and XSL-FO
2.1.11 Using XSL-FO as an intermediate form
2.1.12 Generating XSL-FO instances
2.1.13 Using XSL-FO on a server
2.1.14 Historical development of the XSL and XSLT Recommendations
2.1.15 XSL information links
2.2 Examples
2.2.1 Hello world example
2.2.2 A detailed example of flowed content
2.2.3 Training material example
3. Basic concepts of XSL-FO
3.1 Basic concepts
3.1.1 Layout-based vs. content-based formatting
3.1.2 Formatting vs. Rendering
3.2 Processing model
3.2.1 Processing model of formatting
3.3 Formatting object XML vocabulary
3.3.1 Vocabulary structure
3.3.2 Direct vs. constraint property specification
3.3.3 Property value expressions
3.3.4 Inherited properties
3.3.5 Shorthand properties
3.3.6 Conformance
3.3.7 Top-level formatting objects
3.3.8 <root> Object
3.3.9 <layout-master-set> Object
3.3.10 <page-sequence> Object
3.3.11 <page-sequence-wrapper> Object
3.3.12 <flow> Object
3.4 Groupings of formatting objects for flow
3.4.1 Groupings of formatting objects for flow
3.4.2 Block-level objects
3.4.3 Inline-level objects
3.4.4 Neutral objects
3.4.5 Out-of-line objects
3.4.6 Out-of-line inline-level objects
4. Area and page basics
4.1 Area model details
4.1.1 Geometric rendered areas
4.1.2 Directions and writing modes
4.1.3 Margins, spaces and positioning
4.1.4 Length values for widths and spacing
4.1.5 Area types
4.1.6 Stacking area and rectangle relationships
4.1.7 Allocation rectangles and alignment
4.1.8 Line areas
4.1.9 Superscript and subscript
4.1.10 References in the area tree
4.2 Block and inline basics
4.2.1 Simple block and inline objects
4.2.2 <wrapper> Object
4.2.3 <block> Object
4.2.4 Preserving white space
4.2.5 <initial-property-set> Object
4.2.6 <inline> Object
4.2.7 <page-number-citation> Object
4.2.8 <page-number-citation-last> Object
4.3 Page definition and sequencing basics
4.3.1 Simple page layout definition
4.3.2 Spans and columns in simple page geometry
4.3.3 <simple-page-master> Object
4.3.4 <region-body> Object
4.3.5 Page sequence titling
4.3.6 <title> Object
5. Generic body constructs
5.1 Lists
5.1.1 Aligned pairs of block-level constructs
5.1.2 List constructs
5.1.3 Nested list constructs
5.1.4 <list-block> Object
5.1.5 <list-item> Object
5.1.6 <list-item-label> Object
5.1.7 <list-item-body> Object
5.1.8 When is a list not a list?
5.2 Graphics and foreign objects
5.2.1 Non-textual information
5.2.2 <external-graphic> Object
5.2.3 <instream-foreign-object> Object
5.2.4 Exposing the image size scaling factor
5.2.5 <scaling-value-citation> Object
5.3 Links
5.3.1 Link requirements
5.3.2 <basic-link> Object
5.4 Leaders
5.4.1 Elastic and inelastic inline areas
5.4.2 Multiple leaders on a single line
5.4.3 Controlling the distance between leaders
5.4.4 <leader> Object
6. Tables
6.1 Tabular structure
6.1.1 Aligned tuples of block-level constructs
6.1.2 Table-related formatting objects
6.2 Tabular appearance
6.2.1 Table and cell borders
6.2.2 Spanning cells
6.2.3 Table and cell alignment
6.2.4 <table-and-caption> Object
6.2.5 <table-caption> Object
6.2.6 <table> Object
6.2.7 <table-column> Object
6.2.8 <table-header> Object
6.2.9 <table-footer> Object
6.2.10 <table-body> Object
6.2.11 <table-row> Object
6.2.12 <table-cell> Object
7. Floats, footnotes and containers
7.1 Conditional reference areas and sub-regions
7.1.1 Conditional reference areas and sub-regions
7.2 Floats
7.2.1 Float definition
7.2.2 <float> Object
7.2.3 The interaction of blocks and floats
7.3 Footnotes
7.3.1 Footnote definition
7.3.2 <footnote> Object
7.3.3 <footnote-body> Object
7.4 Container basics
7.4.1 Containers
7.4.2 Block containers
7.4.3 <block-container> Object
7.4.4 <inline-container> Object
8. Flows, static content and page geometry sequencing
8.1 Page regions, headers, and footers
8.1.1 Region dimensions
8.1.2 <region-before> Object
8.1.3 <region-after> Object
8.1.4 <region-start> Object
8.1.5 <region-end> Object
8.2 Content definition
8.2.1 Flowed content vs. static content
8.2.2 Flow maps
8.2.3 <flow-map> Object
8.2.4 <flow-assignment> Object
8.2.5 <flow-source-list> Object
8.2.6 <flow-name-specifier> Object
8.2.7 <flow-target-list> Object
8.2.8 <region-name-specifier> Object
8.2.9 Headers and footers
8.2.10 <static-content> Object
8.2.11 <page-number> Object
8.2.12 <folio-prefix> Object
8.2.13 <folio-suffix> Object
8.2.14 Dynamic content in static content
8.2.15 <marker> Object
8.2.16 <retrieve-marker> Object
8.2.17 <retrieve-table-marker> Object
8.2.18 Planning a simple page sequence specification
8.3 Page Sequence Master Interleave (PSMI)
8.3.1 Changing the page geometry based on authored content
8.4 Page geometry sequencing
8.4.1 Changing the page geometry based on a pattern of geometries
8.4.2 Overview of page sequence specifications
8.4.3 Page geometry sub-sequences
8.4.4 Forced blank pages
8.4.5 <page-sequence-master> Object
8.4.6 <single-page-master-reference> Object
8.4.7 <repeatable-page-master-reference> Object
8.4.8 <repeatable-page-master-alternatives> Object
8.4.9 <conditional-page-master-reference> Object
8.4.10 Planning a more complex page sequence specification
9. Bookmarks and indexes
9.1 Bookmarks
9.1.1 Bookmarks
9.1.2 <bookmark-tree> Object
9.1.3 <bookmark> Object
9.1.4 <bookmark-title> Object
9.2 Indexes
9.2.1 Resolving indexing page numbers
9.2.2 Preparing the content for indexing
9.2.3 <index-range-begin> Object
9.2.4 <index-range-end> Object
9.2.5 Assembling indexing citations
9.2.6 <index-page-citation-list> Object
9.2.7 <index-page-citation-list-separator> Object
9.2.8 <index-page-citation-range-separator> Object
9.2.9 <index-key-reference> Object
9.2.10 <index-page-number-prefix> Object
9.2.11 <index-page-number-suffix> Object
10. Breaks, keeps, spacing, borders and backgrounds
10.1 Break conditions
10.1.1 Breaks
10.2 Widows and orphan control
10.2.1 Widows and orphans
10.3 Keep conditions
10.3.1 Keeps
10.3.2 Examples of keeps
10.3.3 Keep strength
10.4 Control of the spacing between areas
10.4.1 Spacing, conditionality and precedence
10.4.2 Character spacing
10.5 Border specifications
10.5.1 Borders
10.6 Displaying backgrounds
10.6.1 Backgrounds
10.6.2 Decorating page columns using a background
11. Supplemental objects
11.1 Specialty vocabulary
11.1.1 Change bars
11.1.2 <change-bar-begin> Object
11.1.3 <change-bar-end> Object
11.1.4 Color system specification
11.1.5 <color-profile> Object
11.1.6 <declarations> Object
11.1.7 Characters and bi-directional text
11.1.8 <character> Object
11.2 Bidirectional writing support
11.2.1 The importance of bidirectional text
11.2.2 The mechanics of mixing text of different writing directions
11.2.3 Illustration of bidirectional embedding
11.2.4 The bidirectional support challenge
11.2.5 <bidi-override> Object
12. Interactive objects
12.1 Reflecting formatting object state by appearance
12.1.1 Dynamically changing property values
12.1.2 <multi-properties> Object
12.1.3 <multi-property-set> Object
12.2 Interactively changing the effective flow
12.2.1 Dynamically changing formatting object sub-trees
12.2.2 <multi-switch> Object
12.2.3 <multi-case> Object
12.2.4 <multi-toggle> Object
13. Where XSL-FO 1 falls short
13.1 Page-related formatting requirements
13.1.1 Arbitrating between retrieved content
13.1.2 Retrieving markers into the body
13.1.3 Line numbering
13.1.4 Footnotes
13.1.5 Determining the current formatted location
13.2 Geometry-related formatting requirements
13.2.1 Choosing page geometry based on page content
13.3 Alignment of areas
13.3.1 Aligning flows and marks
A. Using XSLT with XSL-FO
A.1 XSLT language features supporting XSL-FO
A.1.1 <xsl:attribute-set> instruction
A.1.2 Simpler list and footnote structures in XSL-FO
A.2 XSL-FO language features similar to XSLT and XPath
A.2.1 Common errors writing expressions
B. XSL-FO expressions
B.1 XSL-FO expressions
B.1.1 Production summary
B.2 XSL-FO functions
B.2.1 Function summary
B.2.2 Function groupings
B.2.3 Functions summarized by name
C. XSL-FO object summary
C.1 Formatting objects
C.1.1 Objects summarized by name
C.1.2 Prototypical hierarchy
C.1.3 Objects summarized by type
D. XSL-FO property summaries
D.1 Property groupings
D.1.1 Common Absolute Position Properties
D.1.2 Common Accessibility Properties
D.1.3 Common Aural Properties
D.1.4 Common Border, Padding, and Background Properties
D.1.5 Common Font Properties
D.1.6 Common Hyphenation Properties
D.1.7 Common Margin Properties-Block
D.1.8 Common Margin Properties-Inline
D.1.9 Common Relative Position Properties
D.2 Data types
D.2.1 Property data types
D.2.2 Recommendation bibliography
D.2.3 Format tokens from XSLT 1.0 subset
D.3 Property summaries
D.3.1 Inherited properties
D.3.2 Shorthand properties
D.3.3 Property summary
E. Sample tool information
Notices
Copyrights
[[1] - Pursuant to [http://www.w3.org/Consortium/Legal/ipr-notice.html], some information included in this publication is from copyrighted material from the World Wide Web Consortium as described in [http://www.w3.org/Consortium/Legal/copyright-documents.html]: Copyright (C) 1995-2008 World Wide Web Consortium, (Massachusetts Institute of Technology, Institut National de Recherche en Informatique et en Automatique, Keio University). All Rights Reserved. The status and titles of the documents referenced are listed in the body of this work where first used.
 [1] - Other original material herein is copyright (C) 1998-2008 Crane Softwrights Ltd. This is commercial material and may not be copied or distributed by any means whatsoever without the expressed permission of Crane Softwrights Ltd.
]
Disclaimer
[[1] - By purchasing and/or using any product from Crane Softwrights Ltd. ("Crane"), the product user ("reader") understands that this product may contain errors and/or other inaccuracies that may result in a failure to use the product itself or other software claiming to utilize any proposed or finalized standards or recommendations referenced therein. Consequently, it is provided "AS IS" and Crane disclaims any warranty, conditions, or liability obligations to the reader of any kind. The reader understands and agrees that Crane does not make any express, implied, or statutory warranty or condition of any kind for the product including, but not limited to, any warranty or condition with regard to satisfactory quality, merchantable quality, merchantability or fitness for any particular purpose, or such arising by law, statute, usage of trade, course of dealing or otherwise. In no event will Crane be liable for (a) punitive or aggravated damages; (b) any direct or indirect damages, including any lost profits, lost savings, damaged data or other commercial or economic loss, or any other incidental or consequential damages even if Crane or any of its representatives have been advised of the possibility of such damages or they are foreseeable; or (c) for any claim of any kind by any other party. Reader acknowledges and agrees that they bear the entire risk as to the quality of the product.
]
Preface
Preface
The main content of this book is in an unconventional style primarily in bulleted form
[[1] - derivations of the book are used for instructor-led training, requiring the succinct presentation
[[2] - note the exercises included in instructor-led training sessions are not included in the book
][1] - derivations of the book can be licensed and branded for customer use in delivering training
 [1] - the objective of this style is to convey the essence and details desired in a compact, easily perused form, thereby reducing the search for key words and phrases in lengthy paragraphs
 [1] - each chapter of the book corresponds to a module of the training
 [1] - each page of the book corresponds to a frame presented in the training
 [1] - a summary of subsections and their pages is at the back of the book
]
Much of the content is hyperlinked both internally and externally to the book in the 1-up full-page sized electronic renditions:
[[1] - note when using the Acrobat Reader for navigation, the history "back" keystroke sequence is "Ctrl-Left"
 [1] - page references, e.g.: [Chapter 3.]
[[2] - the back-of the book index is hyperlinked to the body of the book
 [2] - the letter references at the bottom of each page are hyperlinked to the index
][1] - construct references are typeset with conventions
[[2] - formatting objects are in monospaced text in brackets, e.g.: <[basic-link]>
 [2] - properties are followed by "=", e.g.: [baseline-shift=]
 [2] - data types are in proportional text in brackets, e.g.: <[angle]>
][1] - references to sections of the Recommendation are in parentheses, e.g.: ([7.13.3])
 [1] - external references are in monospaced text, e.g.: [http://www.w3.org/TR/2001/REC-xsl-20011015/xslspec.html]
 [1] - chapter references in book summary
 [1] - section references in chapter summary
 [1] - subsection references in table of contents at the back of the book
 [1] - no hyperlinks are present in the cut, stacked, half-page, or 2-up renditions of the material
]
Prologue
This book is oriented to the XSL-FO stylesheet writer, not the XSL-FO processor implementer
[[1] - certain behaviors important to an implementer are not included
 [1] - objective to help a stylesheet writer understand the language facilities needed to solve their problem
[[2] - a language reference arranged thematically to assist comprehension
 [2] - a different arrangement than found in the Recommendation itself
]]
This book covers every formatting object of XSL-FO both versions 1.0 and 1.1:
[[1] - [F1.0]content specific to XSL-FO 1.0 is marked with a "1.0" icon at the beginning of the line
 [1] - [F1.1]content specific to XSL-FO 1.1 is marked with a "1.1" icon at the beginning of the line
]
First two chapters are introductory in nature
[[1] - overview of context of XSL-FO amongst other members of the XML family of Recommendations
 [1] - basic flow diagrams illustrate use of XSL-FO
 [1] - basic terminology and concepts are defined and explained
]
Third chapter covers the basics of the area model and page model
[[1] - an understanding of the conceptual rendering areas being created by the stylesheet writer
 [1] - important to understand these models in order to apply the language features
]
Fourth through twelfth chapters address XSL-FO vocabulary
[[1] - all objects are described in detail and their properties are summarized
 [1] - significant or important properties are highlighted and described
]
Thirteenth chapter outlines where the XSL-FO vocabulary falls short
[[1] - formatting requirements that are often needed but not available
]
First annex overviews issues of XSLT when working with XSL-FO
[[1] - dependencies on XSLT by XSL-FO
 [1] - issues to remember when writing XSLT
]
Second annex covers XSL-FO expressions
[[1] - rules when writing expressions
 [1] - issues to remember
]
Third and fourth annexes include object and property summaries derived from the Recommendation
[[1] - groupings of objects and properties
 [1] - alphabetical lists of objects and properties
 [1] - print-oriented summary of all productions
]
Last annex addresses questions regarding tools
[[1] - lists of questions for processor implementers when assessing tool capabilities
]
External ZIP file included with the purchase of the book
[[1] - all of the complete scripts utilized in the documentation as stand-alone files ready for analysis and/or modification
]
Epilogue
Where To Go From Here?
The work on XSL and XSLT continues:
[[1] - all XSLT, XPath and XSL-FO are now full W3C Recommendations
 [1] - long list of future feature considerations already being examined for new releases of the technology
 [1] - new products are continually being announced
 [1] - feedback is necessary from users like you!
[[2] - use the XSL mail lists to contribute:
[[3] - [http://www.mulberrytech.com/xsl/xsl-list/]
 [3] - [http://groups.yahoo.com/group/XSL-FO]
 [3] - [http://lists.w3.org/Archives/Public/www-xsl-fo/]
][2] - contact the XSL editors with comments about the specification:
[[3] - xsl-editors@w3.org
]]]
Colophon
These materials were produced using structured information technologies as follows:
[[1] - authored source materials
[[2] - content in numerous XML files maintained as external general entities for a complete prose book that can be made into a subset for training
[[3] - specification of applicability of constructs for each configuration
[[4] - 45- and 90-minute lecture, half-, full-, two- and three-day lecture and hands-on instruction, and book (prose) configurations
][3] - an XSLT transformation creates the subset of effective constructs from applying applicability to the complete file
 [3] - content from other presentations/tutorials included semantically (not syntactically) during construct assembly
][2] - customized appearance engaged with marked sections and both parameter and general entities
[[3] - different host company logos and venue and date marginalia
 [3] - changing a single external parameter entity to a key file includes suite of files for given appearance
]][1] - accessible rendition in HTML
[[2] - an XSLT stylesheet produces a collection of HTML files using Saxon for multiple file output
 [2] - mono-spaced fonts and list-depth notation conventions assist the comprehension of the material when using screen-reader software
][1] - printed handout deliverables
[[2] - an XSLT stylesheet produces an instance of XSL formatting objects (XSL-FO) for rendering
 [2] - XPDF [http://www.foolabs.com/xpdf] extracts raw text from PDF files for the back-of-the-book index methodology published as a free resource by Crane Softwrights Ltd.
 [2] - XEP by RenderX [http://www.renderx.com] produces PostScript from XSL-FO
 [2] - GhostScript [http://www.GhostScript.com] produces PDF from PostScript
 [2] - the iText [http://itext.sf.net] PDF manipulation library for Java is used for page imposition by a custom Python [http://www.python.org] program running under the Jython [http://www.jython.org] environment
]]
Obtaining a copy of the comprehensive tutorial
This comprehensive tutorial on XSL-FO is available for subscription purchase and free preview download:
[[1] - "Practical Formatting Using XSL-FO (Extensible Stylesheet Language Formatting Objects)" Seventh Edition - 2008-01-27 - ISBN 978-1-894049-19-1
[[2] - the free download preview excerpt of the publication indicates the number of pages for each topic
][1] - the cost of purchase includes all future updates to the materials with email notification
[[2] - the materials are updated after new releases of the W3C specifications
 [2] - the materials are updated after incorporating comments gleaned during presentations and from feedback from customers
][1] - available in PDF
[[2] - formatted as 1-up or 2-up book pages per imaged page
 [2] - dimensions in either US-letter or A4 page sizes
 [2] - available as either single sided or double sided, full-page or half-page bound
][1] - accessible rendition available for use with screen readers
 [1] - free preview download includes full text of first three chapters and two useful annexes
 [1] - site-wide and world-wide staff licenses (one-time fee) are available
]
See [http://www.CraneSoftwrights.com/links/trn-20080127.htm] for more details.
Feedback
[[1] - the unorthodox style has been well-accepted by customers as an efficient learning presentation
 [1] - feedback from customers is important to improve or repair the content for future editions
 [1] - please send suggestions or comments (positive or negative) to [info@CraneSoftwrights.com [mailto:info@CraneSoftwrights.com]]
]
US Government employee purchase
[[1] - US Government employees (not contractors) are entitled to obtain their personal prepaid copies at no charge from a government intranet location
 [1] - visit the Crane web site for details
]


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.