A Gentle Introduction to XSL-FO

A place to start.


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-2000 World Wide Web Consortium, (Massachusetts Institute of Technology, Institut National de Recherche en Informatique et en Automatique, Keio University). All Rights Reserved.

As of December 2000, that documents status is: This is a W3C Candidate Recommendation. The XSL Working Group considers that this draft is stable and encourages implementation and comment.

From XML to print without stress.

Introduction and Overview


This para will contain background reading. Src

XSL (Extensible Stylesheet Language) is presently a W3C candidate recommendation that will augment the flexibility of the XML (Extensible Markup Language) standard. XSL is a far more sophisticated style language than is CSS. XSL draws on earlier specifications including CSS and DSSSL. According to the W3C's XSL page,

"Extensible Stylesheet Language (XSL) is a language for expressing stylesheets. It consists of three parts: a language for transforming XML documents [XSLT]; an XML vocabulary for specifying formatting semantics [XSL]and a syntax for addressing parts of a document [XPath]. An XSL stylesheet specifies the presentation of a class of XML documents by describing how an instance of the class is transformed into an XML document that uses the formatting vocabulary."

In other words, a stylesheet tells a processor how to convert logical structures (the source XML document represented as a tree) into a presentational structure (the result tree). Note that an XSL stylesheet is actually an XML document!

In terms of XML Namespaces, an XSL document uses <xsl:> and <fo:>, for transformations and formatting objects, respectively.

It is important to understand that the transformation part can be used independently of the formatting semantics. Common transformations include converting XML to HTML, changing the order of elements, and selectively processing elements. In fact, as of late 2000, most XSL implementations support only the transformation part of the Working Draft; they do not address the formatting objects at all! This may be confusing if you view XSL as mainly for rendering style. There are a number of implementations, which are listed elsewhere in this FAQ.

Basic Processing

Having created a source document in XML with the intent of providing output in print, a two stage process is necessary to create that print. The first step is to transform the source document into XSL. The W3C recs which do this are XSLT and XPATH. These are used in combination to produce a document which conforms to the XSL working draft, and use a processor such as XT or Saxon, which implement these recs. The final stage is to use a processor which implements XSL, such as Renderxor Antenna Hosue or fop, to produce output ready for printing.


Transformation is the process of getting from a source xml document into another XML document which conforms to the appropriate vocabulary known as XSL. This process often re-arranges original sequences, introduces other material or ignores certain source content. For example, to automatically generate a table of contents or an index. It can be used to obtain various vocabularies, most typically HTML or XSL.

Rather than try to do it myself, might I refer you to an excellent series of slides by Norman Walsh. These may be found at Norms home page and provide a good introduction to transformation.

fo stylesheets

The basic fo stylesheet explained.

WARNING Most of this content is from the current Working Draft. Where I understand it sufficiently to translate into plain English, I have done. Where I haven't, you are seeing snippets from the Working Draft. Within that document there is a caveat which reads

This document is intended for implementors of such XSL processors. Although it can be used as a reference manual for writers of XSL style sheets, it is not tutorial in nature.

Minimally (and not very usefully) this is the top few levels of the input xml to a fo processor which will deliver rendered output to either paper or screen. I'll explain each area further.


			<-- defines the geometry and sequencing of the pages -->
                        <-- the pagination and layout specifications -->
   <fo:simple-page-master master-name="master-pages-for-all">

   <fo:page-sequence-master master-name="sequence-of-pages">
	    <fo:repeatable-page-master-reference master-name="master-pages-for-all" />

 <fo:page-sequence master-name="sequence-of-pages">
   <fo:static-content flow-name="xsl-region-before">
	           <--provide the content that is static -->
                   <--within a page [e.g. Headers ] -->

  <fo:static-content flow-name="xsl-region-after">
	           <--provide the content that is static -->
                   <--within a page [e.g. footers] -->

   <fo:flow flow-name="xsl-region-body">
                   <--provides most of the content -->
                   <--of the document -->


The major sections within such a document instance are described below

fo:root. The root element for XSL-FO.

fo:layout-master-set. Defines the geometry and sequencing of the pages which are contained in the document. Acts as a wrapper for these two.

fo:simple-page-master. Defines the size and shape of a page, the major regions into which the page is divided (main body, footer areas etc). There will be one of these (named) for each differing page layout. The master-name attribute or trait is used to identify it. It will be referenced indirectly from either a page-sequence-master element, or directly from a page-sequence.

fo:page-sequence-master. Specifies which simple-page-master is used at which time as the document is laid out by the renderer. This selection is based on the availability of content from the XML source, and the conditions specified in the attributes of the element.

fo:page-sequence. Wrapper for the actual content derived from the source XML document or entered by hand. For each variant (in terms of content) of a basic page layout, there will be one page-sequence.

fo:static-content. Static as in fixed location within a page, e.g. headers and footers, whether these are at the top and bottom or either side of a page.

fo:flow. Finally, the actual content to be laid out into the main page areas, the region named xsl-region-body.

To take each of these in turn. For those, like me, who hate learning a new set of jargon, I've done my best to clarify the terms used. Unfortunately it is hard to avoid it, and as the warning states, the working draft is not written for easy understanding.

The first specification then is for the size, orientation and shape of the page needed for a document type. Next is specified the sequence in which these masters are used, such as front-page, odd-page and even-page pairs, then back-page. This gives the physical paper size. Page decorations are specified in terms of header and footer content, including page numbers etc.

page-sequence elements have overall initial control of the formatter. As content is found from the XML document, a page layout is sought for that content. the master-name attribute is used to determine where to find that layout. This could refer directly to a simple-page-master, or indirectly via the page-sequence-master, which in turns works out which simple-page-master to use.

Page-sequence-masters have the role of describing the sequence of page-masters that will be used to generate pages during the formatting of an fo:page-sequence. They determine which page-masters are used and in which order.

For example, a sequence might begin with several explicit simple-page-masters and continue with a repetition of some other simple-page-master (or masters).

Which of the alternative page-masters is used at a given point in the sub-sequence is conditional and may depend on whether the page number is odd or even, is the first page, is the last page, or is blank.

Defining page layout


<fo:layout-master-set> is the wrapper for both page masters and page sequences, Its children define the geometry and sequencing of the pages of a document.


<fo:simple-page-master> is the layout child of the layout-master-set. A simple-page-master is a master that is used to define the regions of a page into which content is flowed. If you want to rotate a page then this is where it is specified, using the reference-orientation attribute on one (surely all!) of the regions of the page. Rotation is specified in terms of a compass idea, with 0° being North, 90° is West, 180° being South, and 270° being East.

An fo:simple-page-master has, as children, specifications for one or more regions.

Page regions

The regions on the page are analogous to "frames" in an HTML document. Typically, at least one of these regions is of indefinite length in one of its dimensions. The viewport represents the visible part of the frame. The flow assigned to the region is viewed by scrolling the region reference-area through the viewport.

A page-master can consist of up to five regions: "region-body" and four other regions, one on each side of the body. These regions are named "region-before" "region-after" "region-start" and "region-end".


<fo:page-sequence-master> is the sequencing child of the layout-master-set and has the role of describing the sequence of simple-page-masters that will be used to generate pages during the formatting of an fo:page-sequence. It determines which page-masters are used and in which order.

For example, a sequence might begin with several explicit page-masters and continue with a repetition of some other page-master (or masters).

Which of the alternative page-masters is used at a given point in the sub-sequence is conditional and may depend on whether the page number is odd or even, is the first page, is the last page, or is blank. The use of a repeatable-page-master-reference with an attribute of "maximum-repeats" property controls the number of repetitions. If this property is not specified, there is no limit on the number of repetitions.

Each fo:page-sequence references either an page-sequence-master or a simple-page-master, using the master-name attribute. If the reference is to a simple-page-master, this is interpreted as if it were a reference to an fo:page-sequence-master that repeats the referenced page-master an unbounded number of times. In plain English this means it keeps on using that layout until all the data it contains is laid out, i.e. exhausted. Use this option if there is no sequencing to be done with the content, for example in the case of a single page which is special, or any multiple sequences of pages which don't have any special requirements. Reference a page-sequence-master when you need to treat individual pages within a sequence specially, e.g. if you want the inner margins bigger than the outer margins, or other natural sequences which rely on conditions specified within the page-sequence-master.

fo:single-page-master-reference is used to specify a sub-sequence consisting of a single page-master.

There are two ways to specify a sub-sequence that is a repetition. The fo:repeatable-page-master-reference specifies a repetition of a single page-master. The fo:repeatable-page-master-alternatives specifies the repetition of a set of page-masters. Which of the alternative page-masters is used at a given point in the sub-sequence is conditional and may depend on whether the page number is odd or even, is the first page, is the last page, or is blank. The "maximum-repeats" property on the repetition specification controls the number of repetitions. If this property is not specified, there is no limit on the number of repetitions.


This element is where the formatter goes to start the whole process.!

With yet more help from Nikolai, I think I now understand it a little better. I've used the example to describe how I went from an initial requirement to the contents of the file pages.xsl, which specifies the page layout.

Starting from the top. I want:

1st page special, a fancy front sheet.
Next few pages normal portrait, headers and footers - The Introduction and section 2
Next section, section 3, is landscape, two columns headers on the left, footers on the right.
Next section, section 4, portrait, two columns, headers back in their normal place.
Section 5 onwards, as per Introduction and section 2.

So, I need a page-master for each different layout. By layout I mean page dimensions (geometry), header and footer specifications in terms of borders and sizes (from simple-page-masters) and their content, from page-sequences. This means that since I don't want headers and footers on the first page, yet do on the second, I can't put them both in the same sequence, hence they have to use their own simple-page-master and page-sequence.

The logic behind my particular reasoning here is that I have a template match within an fo:page-sequence which selects a particular part of the XML source document. Thats the only reason I needed almost the same number of page-sequence elements as simple-page-masters.

Using the page-master master-name attributes I have:

first - fancy front page
rest - Introduction, section 3 and section 6.
twocolsP - Portrait two columns - section 4
twocolsL - Landscape two columns - section 5

To achieve this I need to use a mix of references to simple-page-master and page-sequence-master. I could have used direct references to simple-page-master only, but I wanted to include a page-sequence-master, so I have!


Listen carefully here, its a long story! This is the sequence the formatter goes through when you invoke it to lay out your pages.

In order to determine what content goes into which simple-page-master layout, The formatter follows the following logic, very much simplified, and thanks to Arved of fop fame (thanks Arved)

(1). Looks for the first page-sequence element in document order (This beast is not order independant!). Get the master-name from the page-sequence. If it refers to a simple-page-master, layout the content with page geometry from the simple-page-master. Keep on doing this until all data exhausted from the template-match in the page-sequence. When exhausted, try the next page-sequence in document order. Repeat from (1), using next page-sequence element

If it refers to a page-sequence-master (2) Take the first sub-sequence in the page-sequence master. (this could be any one of (single-page-master-reference| repeatable-page-master-reference| repeatable-page-master-alternatives)+

if the 'conditions' expressed in the sub-sequence are met * get the simple-page-master referenced from the sub-sequence and layout the content with page information from the simple-page-master. Keep on doing this until all data exhausted from the template-match in the page-sequence or the 'condition' * is no longer valid. if the 'conditions' are not met, move on to the next sub-sequence. and repeat from (2) using the 'next' sub-sequence.

WARNINGMoving on to the next sub-sequence (i.e. not using the same sub-sequence twice) only applies to this particular page-sequence. The 'counter' is reset to zero once a particular page-sequence is 'used up' and the formatter moves on to the next page-sequence.

* The conditions might be, for instance, odd, even, or first page; Number of pages specified in a repeatable-page-master-reference etc.

So having understood how it does it, here goes to determine the content of page-sequence-master(s)

For the fancy front page I refer directly to the page without headers and footers, named 'first'.

For sections 1 and 2 I need a - for remainder of section 1 and section 2. This is done using the simple-page-master named 'rest'.

This will be called up from the template match within the first page-sequence, using a match pattern of "/simpdoca/section[1]" The corresponding page-sequence-master will refer to the page-masters 'first'

For section 2 I need another page-sequence with match pattern "/simpdoca/section[2]" This will reference the second page-sequence-master, which will have content repeatable-page-master-reference, which will reference the 'rest' simple-page-master.

For section 3, just a single page, in the page-sequence I will refer directly to the simple-page-master twocolsL

For section 4, again a single page, in the page-sequence I will refer directly to the simple-page-master twocolsP.

For section 5, multiple pages, I will refer directly to the simple-page-master 'rest'

Phew. Did you follow the sequence there? You will need to when you need more than one different page layout! How about putting that table from chapter 5 on a landscape page :-)

A brief look at syntax

fo:root  (layout-master-set,declarations?,page-sequence+)
fo:layout-master-set   (simple-page-master|page-sequence-master)+

See para 6.4.12 for a fairly clear description. Note especially the terminology used!

A simple start might be

	    margin-left = "0.75in"



This little lot had me very confused. Being a simple person, and not from the print industry, I guessed or assumed, that the header and footer go into the top and bottom margins. Nope. The header and footer as I think of them, are areas within the region-body, set aside in this example, by the margin-top and margin-bottom attributes of the region-body, into which fits the region-before and region-after 'extents'. I've deliberately made one smaller than the other to make this obvious. There are a number of diagrams in section 6.4.12 which show this. It didn't do me any good, but it may help you!


(common border padding and background, see 7.6) Lots of decorations, but complexity can be avoided! the following can be specified

background ~ color, image, repeating, position
borders ~ color, style, width
space-before and after
start and end indents
the number of columns
the gap between the columns
reference-orientation (0 | 90 | 180 | 270 | inherit)

How would you like it sir/madam? Remember that 0 is normal, top to top etc. 90 degrees rotation means rotated counter-clockwise! and

writing mode (defaults to left to right, top to bottom)

Quite a lot for a main region of a simple page master! A basic set without frills might be:


Auto alignment and overflow are managed by the renderer OS combination.

This latter is difficult, since in some circumstances a page can have clipped content which is only realised when an end user complains because the author hasnt' noticed it.

<fo:region-body overflow="visible"> is nice to have, but dependant on the implementation.

Simple page masters. 6.4.12

For a simple-page-master, with header and footer, the following example seems fairly clear

		 text-align="start">Document Title</fo:block><!-- Header left -->
                 text-align="end">Page <fo:page-number/> <!-- Header Right -->

This is the header. I've used the list format to obtain the seperation between left and right headers. The footer is the same, but using flow-name xsl-region-after.

The body is even simpler.

 <fo:flow flow-name="xsl-region-body"> 
    <xsl:apply-templates select="/simpdoca/section[4]"/>

All this does is name the region its going into, and say what content you want in it.


XSL provides a comprehensive model and a vocabulary for writing such stylesheets using XML syntax.

formatting object

Semantically, each formatting object represents a specification for a part of the pagination, layout, and styling information that will be applied to the content of that formatting object as a result of formatting the whole result tree. Some formatting objects are block-level and others are inline-level.

The semantics of each type of formatting object that generates areas are given in terms of which areas it generates and their place in the area-tree hierarchy. This may be further modified by interactions between the various types of formatting objects. The properties of the formatting object determine what areas are generated and how the formatting object's content is distributed among them. (For example, a word that is not to be hyphenated may not have its glyphs distributed into areas on two separate line-areas.)

formatting property

Finer control over the presentation of these abstractions is provided by a set of formatting properties, such as those controlling indents, word- and letter-spacing, and widow, orphan, and hyphenation control.The properties associated with an instance of a formatting object control the formatting of that object. Some of the properties, for example "color", directly specify the formatted result. Other properties, for example 'space-before', only constrain the set of possible formatted results without specifying any particular formatted result.

Source XML

The input to the process, normally an xml document instance.

result tree

This tree is composed of formatting objects.

fo namespace

set of fo: element types - represents the set of typographic abstractions available to the designer. The XSL specification uses the prefix fo: for referring to elements in the XSL namespace. However, XSL stylesheets are free to use any prefix, provided that there is a namespace declaration that binds the prefix to the URI of the XSL namespace. The XSL namespace has the URI http://www.w3.org/1999/XSL/Format

tree structure:

The terms child, sibling, parent, descendant, and ancestor refer to this tree structure. The tree has a root node at which descendants are connected. siblings share the same conceptual level and ancestors may be viewed as being closer to the root node.


An area is associated to a rectangular portion of the output medium. Areas are not formatting objects; rather, a formatting object generates zero or more rectangular areas, and normally each area is generated by a unique object in the formatting object tree.

An area has a content-rectangle, the portion in which its child areas are assigned, and optional padding and border. Content is surrounded by padding which is in turn surrounded by a border.

Reference Area

The Boolean trait is-reference-area determines whether or not an area establishes a coordinate system for specifying indents. An area for which this trait is true is called a reference-area. Only a reference-area may have a block-progression-direction which is different from that of its parent. A reference-area may be either a block-area or an inline-area.

block area and in-line area:

An area can have block-area children or inline-area children as determined by the generating formatting object, but a given area's children must all be of one type. A line-area is a special kind of block-area whose children are all inline-areas. A glyph-area is a special kind of inline-area which has no child areas, and has a single glyph image as its content.

Typical examples would be: a paragraph rendered by using an fo:block formatting object, which generates block-areas, and a character rendered by using an fo:character formatting object, which generates an inline-area (in fact, a glyph-area).


The region surrounding content which is inside any margins.


The region surrounding padding (which surrounds content) and lies inside margins.

Area tree:

Formatting consists of the generation of a tree of geometric areas, called the area tree.Each geometric area has a position on the page, a specification of what to display in that area and may have a background, padding, and borders

space-before, space-after, space-start, and space-end specify the amount of space outside the border-rectangle. The style, thickness, and color of each of the four sides of the border can also be specified.

padding-before, padding-after, padding-start, and padding-end; specify the thickness of each of the four sides of the padding

background-color, background-image can be used to specify the background rendering of an area


Rendering takes the abstract model of the presentation (in terms of pages and their collections of areas), and causes a presentation to appear on the chosen output media.


are to areas what properties are to formatting objects and attributes are to XML nodes. Individual traits are used either for rendering the area or for defining constraints on the result of formatting, or both. Traits used strictly for formatting purposes or for defining constraints may be called formatting traits, and traits used for rendering may be called rendering traits.

Property to Trait Mapping. The majority of the properties map into traits of the same name. Most of these also simply copy the value from the property. (but see 5.4 of the rec for details)

refined formatting object tree.

The stage at which property inheritance is resolved, computed values are processed, expressions are evaluated and duplicate corresponding properties are removed. fo's and properties become fo's and traits.

area tree:

An ordered tree containing geometric information for the placement of every glyph, shape, and image in the document, together with information embodying spacing constraints and other rendering information;


This formatting object allows us to define independently filled regions for the body , a header, a footer, and side-bars on a page.

It does not specify content for those regions, simply the size and position

page sequence:

An order of usage of simple-page-masters, and how styled content is to fill those pages

Area model:

The area model provides a vocabulary for describing the relationships and space-adjustment between letters, words, lines, and blocks.

(before, after, start, and end),

To the Western reader, these could represent top, bottom, left and right. but these are relative to the "writing-mode". The "writing-mode" property is a way of controlling the directions to correctly place glyphs, words, lines, blocks, etc. on the page or screen. There are writing-modes for "left-to-right - top-to-bottom" (denoted as "lr-tb"), "right-to-left - top-to-bottom" (denoted as "rl-tb"), "top-to-bottom - right-to-left" (denoted as "tb-rl") and more.


is typically left to right for Western use.


is typically top to bottom for Western use.pa

Tree Construction:

The building of the output tree, on which the formatter works to lay content out on a page.


is the process of turning the result of an XSL transformation into a tangible form for the reader or listener.


Areas returned to an fo:root formatting object. They are children of the area tree root. It is an area which establishes an opening through which its descendant areas can be viewed, and can be used to present content. For each page, the page-viewport-area corresponds to the output medium.

depth-first traversal:

The way in which a processor approaches the transformation of an XML document.


establishes a coordinate system for specifying indents


The allocation-rectangle of an area is used to describe the constraints on the position of the area within its parent area. For an inline-area this extends to the content-rectangle in the block-progression-direction and to the border-rectangle in the inline-progression-direction. The content rectangle is bounded by the padding rectangle which in turn is bounded by the border rectangle.

For a block-area, the allocation-rectangle extends to the border-rectangle in the block-progression-direction and outside the content-rectangle in the inline-progression-direction by an amount equal to the end-indent, and in the opposite direction by an amount equal to the start-indent. (Shown graphically in section 4.2.3)


the before-edge is the edge occurring first in the block-progression-direction (above); the after-edge is the edge opposite the before-edge(beneath); the start-edge is the edge occurring first in the inline-progression-direction(left), the end-edge is the edge opposite the start-edge (end). Bracketed items refer to a common Western usage. See rec, section 4.2.3 for a diagram showing all the terms, in Western and other 'directions'


A data type having minimum, optimum, and maximum, conditionality, and precedence components. Minimum, optimum, and maximum are lengths and can be used to define a constraint on a distance, namely that the distance should preferably be the optimum, and in any case no less than the minimum nor more than the maximum. The constraint imposed on a distance by a sequence of resolved space-specifiers is additive; that is, the distance is constrained to be no less than the sum of the resolved minimum values and no larger than the sum of the resolved maximum values.

Keeps and Breaks:

Break conditions are either break-before or break-after conditions. Keep conditions are either keep-with-previous, keep-with-next, or keep-together conditions.

For example, its reasonable to have each new section of a document start on a new page. This can be achieved by setting the break-before property to 'page'. Equally, its nice to have a figure and its description on the same page, hence we could set the keep-with-next.within-page property on the former to always.


The background, if specified, is rendered in the padding-rectangle, in accordance with the background-image, background-color, background-repeat, background-position-vertical, and background-position-horizontal attributes.

Specified, Computed, and Actual Values, and Inheritance:

This relates to values specified for attributes. These go through a series of refinement from specified values to actual values. Attribute values on flow objects are determined from either explictly stated values, inherited values or initial values.

Inheritance example: if the "writing-mode" at the top level of a document is "lr-tb", then "padding-start" corresponds to "padding-left", but if the "writing-mode" is "rl-tb", then "padding-start" corresponds to "padding-right".

For every property that is applicable to a given formatting object, it is necessary to determine the value of the property. Three variants of the property value are distinguished: the specified value, the computed value, and the actual value. The "specified value" is one that is placed on the formatting object during the tree-construction process. A specified value may not be in a form that is directly usable; for example, it may be a percentage or other expression that must be converted into an absolute value. A value resulting from such a conversion is called the "computed value". Finally, the computed value may not be realizable on the output medium and may need to be adjusted prior to use in rendering. For example, a line width may be adjusted to become an integral number of output medium pixels. This adjusted value is the "actual value."


A relative unit of measure. The definition of "1em" is equal to the current font size. For example, a value of "1.25em" is 1.25 times the current font size.


A color is a set of values used to identify a particular color from a color space. Only RGB and ICC colors are included in this Recommendation. RGB colors are directly represented in the expression language using a hexadecimal notation. ICC colors can be accessed through an icc-color function. See 5.8.9 and 5.9.2 for the color functions.

aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, purple, red, silver, teal, white, and yellow

Units of measure:
Name Definition
cm See ISO 31
mm See ISO 31
in 2.54cm
pt 1/72in
pc 12pt
px (See below)
em See [ Relative Lengths]

XSL interprets a 'px' unit to be a request for the formatter to choose a device-dependent measurement that approximates viewing one pixel on a typical computer monitor. stylesheets utilizing 'px' units may not produce consistent results across different implementations or different output devices from a single implementation.

flow objects:

formatting objects that generate areas and formatting objects that return areas, but do not generate them are called flow objects


There are two kinds of flows: fo:static-content and fo:flow. An fo:static-content flow holds content, such as the text that goes into headers and footers, that is repeated on many of the pages. The fo:flow flow holds content that is distributed across a sequence of pages.

The children of a flow are a sequence of block-level flow objects. Each flow has a name, and no two fo:flow or fo:static-content formatting objects in the same page-sequence may have the same name

formatting objects:

are the basic tools for generating XSL. the reference is the point in the rec that gives a complete list and a brief definition. Some are listed below.

These are either block formatting objects:


or in-line formatting objects:


out of line formatting objects are:

Viewport/Reference pair

When a simple-page-master is used to generate a page, a viewport/reference pair are created.

consists of a page-viewport-area and a page-reference-area. The page-viewport-area represents the physical bounds of the output medium.

The page-reference-area represents the portion of the page on which content is intended to appear; that is, the area inside the page margins.


region-after This region defines a viewport that is located on the "after" side of fo:region-body region.

region-before This region defines a viewport that is located on the "before" side of fo:region-body region.

region-body This region specifies a viewport/reference pair that is located in the "center" of the fo:simple-page-master.

region-end This region defines a viewport that is located on the "end" side of fo:region-body region.

region-start This region defines a viewport that is located on the "start" side of fo:region-body region.

region-after This region defines a viewport that is located on the "after" side of fo:region-body region.

region-before This region defines a viewport that is located on the "before" side of fo:region-body region.

region-body This region specifies a viewport/reference pair that is located in the "center" of the fo:simple-page-master.

region-end This region defines a viewport that is located on the "end" side of fo:region-body region.

region-start This region defines a viewport that is located on the "start" side of fo:region-body region.


The area within a page and inside the four margins. Same area as the page reference area... I think! The area into which content is flowed.


This is a formatting object. It is filled by a page-sequence

The fo:simple-page-master is used in the generation of pages and specifies the geometry of the page. The page may be subdivided into up to five regions, see region-* above

a page-master will consist of up to five regions: "region-body" and four other regions, one on each side of the body. These regions are named "region-before" "region-after" "region-start" and "region-end".


The fo:static-content formatting object holds formatting objects that is to be presented in a single region or repeated in like-named regions on one or more pages in the page-sequence. Its common use is for repeating or running headers and footers.

Orphans and Widows

In publishing, "orphans" and "widows" are terms used almost interchangeably both referring to runover lines of text. If a paragraph has 5 full lines of text and one word on the sixth line, that last word is referred to as an "orphan." A paragraph which starts on one page where the last line of the paragraph starts at the top of the next page is also called an "orphan." Finally, a "widow" is a paragraph which starts at the bottom of a page where only the first line fits on the bottom of the page and the rest is continued on the next page. Because the terms are often used interchangeably, your friend is telling you to "make orphans" by increasing the tracking--space between characters--of your text in order to create more runover lines or by rebreaking lines manually.

Mike Haarman adds

Traditionally, a widow is a line or two of text which breaks to another page, either leading or trailing the body of a paragraph; an orphan is an individual word or hyphenated part which breaks to a line by itself, at a page break or not. The XSL spec uses these terms differently. Here orphans refers to the minimum lines leading a paragraph which must appear before a break and widows refers to the minimum lines to appear after a break at the top of the new page.

These properties apply at the block level and each defaults to two.

They can be applied to block-areas in tables just as to paragraphs.