<?xml version="1.0" encoding="utf-8"?>
<spec>
<header>
<title>Extensible Stylesheet Language (XSL)</title>
<version>Version 1.0</version>
<w3c-designation>xsl-20011015</w3c-designation>
<w3c-doctype>W3C Recommendation</w3c-doctype>
<pubdate><day>15</day><month>October</month><year>2001</year></pubdate>
<publoc>
<loc href="http://www.w3.org/TR/2001/REC-xsl-20011015/" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">http://www.w3.org/TR/2001/REC-xsl-20011015/</loc>
<otherversions>
<loc href="http://www.w3.org/TR/2001/REC-xsl-20011015/xslspecRX.pdf" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">PDF by RenderX</loc>,
<loc href="http://www.w3.org/TR/2001/REC-xsl-20011015/xslspec.xml" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">XML file</loc>,
<loc href="http://www.w3.org/TR/2001/REC-xsl-20011015/xslspec.html" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">HTML (one large file)</loc>,
<loc href="http://www.w3.org/TR/2001/REC-xsl-20011015/xs011015.zip" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">ZIP file</loc>
</otherversions>

</publoc>
<latestloc>
<loc href="http://www.w3.org/TR/xsl/" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">http://www.w3.org/TR/xsl/</loc>
</latestloc>
<prevlocs>
<loc href="http://www.w3.org/TR/2001/PR-xsl-20010828/" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">http://www.w3.org/TR/2001/PR-xsl-20010828/</loc>
</prevlocs>
<authlist>
<author>
<name>Sharon Adler</name>
<affiliation>IBM</affiliation>
<email href="mailto:sca@us.ibm.com" show="new" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">sca@us.ibm.com</email>
</author>
<author>
<name>Anders Berglund</name>
<affiliation>IBM</affiliation>
<email href="mailto:alrb@us.ibm.com" show="new" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">alrb@us.ibm.com</email>
</author>
<author>
<name>Jeff Caruso</name>
<affiliation>Pageflex</affiliation>
<email href="mailto:jcaruso@pageflexinc.com" show="new" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">jcaruso@pageflexinc.com</email>
</author>
<author>
<name>Stephen Deach</name>
<affiliation>Adobe</affiliation>
<email href="mailto:sdeach@adobe.com" show="new" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">sdeach@adobe.com</email>
</author>
<author>
<name>Tony Graham</name>
<affiliation>Sun</affiliation>
<email href="mailto:Tony.Graham@ireland.sun.com" show="new" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">Tony.Graham@ireland.sun.com</email>
</author>
<author>
<name>Paul Grosso</name>
<affiliation>Arbortext</affiliation>
<email href="mailto:paul@arbortext.com" show="new" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">paul@arbortext.com</email>
</author>
<author>
<name>Eduardo Gutentag</name>
<affiliation>Sun</affiliation>
<email href="mailto:eduardo.gutentag@eng.sun.com" show="new" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">eduardo.gutentag@eng.sun.com</email>
</author>
<author>
<name>Alex Milowski</name>
<email href="mailto:alex@milowski.com" show="new" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">alex@milowski.com</email>
</author>
<author>
<name>Scott Parnell</name>
<affiliation>Xerox</affiliation>
<email href="mailto:Scott.Parnell@usa.xerox.com" show="new" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">Scott.Parnell@usa.xerox.com</email>
</author>
<author>
<name>Jeremy Richman</name>
<email href="mailto:JeremyRichman@compuserve.com" show="new" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">JeremyRichman@compuserve.com</email>
</author>
<author>
<name>Steve Zilles</name>
<affiliation>Adobe</affiliation>
<email href="mailto:szilles@adobe.com" show="new" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">szilles@adobe.com</email>
</author>
</authlist>

<status>

<p><emph>This section describes the status of this document at the
time of its publication. Other documents may supersede
this document. The latest status of this series of
documents is maintained at the W3C.</emph></p>

<p>This document has been reviewed by W3C
Members and other interested parties and has
been endorsed by the Director as a W3C
Recommendation. It is a stable document and may
be used as reference material or cited as a
normative reference from another document.
W3C's role in making the Recommendation is to
draw attention to the specification and to promote
its widespread deployment. This enhances the
functionality and interoperability of the Web.</p>

<p>This document has been produced as part of the <loc href="http://www.w3.org/Style/" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">W3C Style Activity</loc> by
the <loc href="http://www.w3.org/Style/XSL/Group/" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">XSL Working Group</loc>
(<loc href="http://cgi.w3.org/MemberAccess/AccessRequest" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">members only</loc>).</p>

<p>General public discussion of XSL takes place
on the <loc href="http://www.mulberrytech.com/xsl/xsl-list/index.html" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">XSL-List</loc>
mailing list.</p>

<p>Please report errors in this document
to <loc href="mailto:xsl-editors@w3.org" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">xsl-editors@w3.org</loc>. <loc href="http://lists.w3.org/Archives/Public/xsl-editors/" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">Archives</loc>
of the comments are available.
The list of known errors in this specification is available at <loc href="http://www.w3.org/2001/10/REC-XSL-20011015-errata" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">http://www.w3.org/2001/10/REC-XSL-20011015-errata</loc>.
Some text in the property definitions has been copied from the CSS2
Recommendation and the list of errors in this specification is
available at <loc href="http://www.w3.org/Style/css2-updates/REC-CSS2-19980512-errata.html" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">http://www.w3.org/Style/css2-updates/REC-CSS2-19980512-errata.html</loc>.
</p>

<p>A list of current W3C Recommendations and other technical documents
can be found at
<loc href="http://www.w3.org/TR/" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">http://www.w3.org/TR/</loc>.</p>

</status>

<abstract>

<p>This specification defines the features and syntax for
the Extensible Stylesheet Language (XSL),
a language for expressing stylesheets. It consists of two
parts:</p>

<olist>

<item><p>a language for transforming XML documents, and</p></item>

<item><p>an XML vocabulary for specifying formatting
semantics.</p></item>

</olist>

<p>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.</p>

</abstract>

<langusage>
<language id="EN">English</language>
<language id="ebnf">EBNF</language>
</langusage>
<revisiondesc>
<slist>
<sitem>See RCS log for revision history.</sitem>
</slist>
</revisiondesc>
</header>
<body>


<div1><head>Introduction and Overview</head>
<p>
This specification defines the Extensible Stylesheet Language
(XSL). XSL is a language for expressing stylesheets. Given a class of
arbitrarily structured XML <bibref ref="XML"/>
documents or data files, designers use
an XSL stylesheet to express their intentions about how that
structured content should be presented; that is, how the source
content should be styled, laid out, and paginated onto some
presentation medium, such as a window in a Web browser or a
hand-held device, or a set of
physical pages in a catalog, report, pamphlet, or book.
</p>
<div2><head>Processing a Stylesheet</head>
<p>
An XSL <term>stylesheet processor</term> accepts a document
or data in XML
and an XSL stylesheet and produces the presentation of that XML source
content that was intended by the designer of that
stylesheet. There are two aspects of this
presentation process:
first, constructing a result tree from the XML source tree and second,
interpreting the result tree to produce formatted
results suitable for presentation on a
display, on paper, in speech, or onto other media. The first
aspect is called <term>tree transformation</term> and the
second
is called <term>formatting</term>. The process of formatting
is performed by the <term>formatter.</term> This formatter
may simply be a rendering engine inside a browser.
</p>
<p>
Tree transformation allows the structure of the result tree to be significantly
different from the structure of the source tree. For example, one could add
a table-of-contents as a filtered selection of an original source document,
or one could rearrange source data into a sorted tabular presentation.
In constructing the result tree,
the tree transformation process also adds the information necessary to
format that result tree.
</p>
<p>Formatting is enabled by including formatting semantics
in the result tree. Formatting semantics are
expressed in terms of a catalog of classes of
<term>formatting
objects.</term> The nodes of the result tree are formatting
objects. The classes of formatting objects
denote typographic abstractions such as page, paragraph,
table, and so
forth. Finer control over the presentation of these abstractions is
provided by a set of formatting properties, such as
those controlling indents, word- and
<spot id="jm010109_7ah"/>letter spacing, and widow, orphan, and hyphenation control.
In XSL, the
classes of <term>formatting objects</term> and
<term>formatting properties</term>
provide the vocabulary for expressing presentation intent.
</p>
<p>
The XSL processing model is intended to be
conceptual only.  An implementation is not
mandated to provide these as separate
processes.  Furthermore, implementations are free to process
the source document in any way that produces the same result
as if it were processed using the conceptual XSL processing
model.  A diagram depicting the detailed conceptual model is
shown below.<spot id="aj000035_1"/></p>
<figure>
<graphic source="two-process.gif" alt="The XSL two processes: transformation and formatting" longdesc="Diagram of XSL conceptual model, showing a source tree, transformed in a result tree with new element and attribute nodes, itself rendered by the XSL formatting on devices including printers, a cell phone and a Web browser." xml:attributes="href source" show="embed" actuate="auto" xmlns:xlink="http://www.w3.org/TR/WD-xlink"/>
<figcap><p>XSL Two Processes: Transformation &amp; Formatting</p></figcap>
</figure>
<div3><head>Tree Transformations</head>
<p>
Tree transformation constructs the result tree.  In XSL,
this tree is called the <term>element and attribute
tree,</term> with objects primarily in the
"formatting object" namespace. In this tree, a formatting
object
is represented as an XML element, with the properties represented by a
set of XML attribute-value pairs. The content of the formatting object
is the content of the XML element. Tree
transformation is defined in the XSLT Recommendation
<bibref ref="XSLT"/>.
A diagram depicting this conceptual process is
shown below.</p>
<figure>
<graphic source="tree1-2.gif" alt="The XSL Transformation process" longdesc="Detail of the previous diagram, showing the conceptual source and result trees, and describing that the transformation process can produce a result tree that has a quite different structure than that of the source tree." xml:attributes="href source" show="embed" actuate="auto" xmlns:xlink="http://www.w3.org/TR/WD-xlink"/>
<figcap><p>Transform to Another Vocabulary</p></figcap>
</figure>
<p>
The XSL stylesheet is used in tree transformation. A stylesheet
contains a set of tree construction rules. The tree construction rules
have two parts: a pattern that is matched against elements in the
source tree and a template that constructs a portion of the result
tree. This allows a stylesheet to be applicable to a wide class of
documents that have similar source tree structures.
</p>
<p><spot id="wai_1"/>In some implementations of XSL/XSLT,
the result of tree construction
can be output as an XML document. This would allow an XML document
which contains formatting objects and formatting properties to be
output. This capability is neither necessary for an XSL processor nor
is it encouraged. There are, however, cases where this is important,
such as a server preparing input for a known client; for example, the way
that a WAP
(<xspecref href="http://www.wapforum.org/faqs/index.htm" show="new" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">http://www.wapforum.org/faqs/index.htm</xspecref>)
server prepares specialized input for a WAP capable
hand held device. To preserve accessibility, designers of Web systems
should not develop architectures that require (or use) the
transmission of documents containing formatting objects and properties
unless either the transmitter knows that the client can accept
formatting objects and properties or the transmitted document contains
a reference to the source document(s) used in the construction of the
document with the formatting objects and properties.
</p>
</div3>
<div3><head>Formatting</head>
<p>
Formatting interprets the result tree in its formatting object tree
form to produce the presentation intended by the designer
of the stylesheet from which the XML element and attribute
tree in the "fo" namespace was constructed.
</p>
<p>
The vocabulary of formatting objects supported by XSL - the set of
<code>fo:</code> element types - represents the set of
typographic abstractions available to the
designer. 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. Each
formatting object class represents a particular kind of formatting
behavior. For example, the block formatting object class represents
the breaking of the content of a paragraph into lines. Other parts of
the specification may come from other formatting objects; for
example, the formatting of a paragraph (block formatting
object)
depends on both the specification of properties on the block
formatting object and the specification of the layout structure into
which the block is placed by the formatter.
</p>
<p>
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. The formatter may make choices among other
possible considerations such as esthetics.
</p>
<p>
Formatting consists of the generation of a tree
of geometric areas, called the <term>area tree</term>. The
geometric areas are
positioned on a sequence of one or more pages (a browser typically
uses a single page). 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. For example, formatting a
single
character generates an area sufficiently large enough to hold the
glyph that is used to present the character visually and the glyph is
what is displayed in this area. These areas may be nested. For
example, the glyph may be positioned within a line, within a
block, within a page.
</p>
<p>
Rendering
takes the area tree, the abstract model of the presentation (in terms
of pages and their collections of areas), and causes a
presentation to appear on the relevant medium, such as a browser
window on a computer display screen or sheets of paper. The semantics
of rendering are not described in detail in this specification.
</p>
<p>
The first step in formatting is to "objectify" the element
and attribute
tree obtained via an XSLT transformation.
Objectifying the tree basically consists of turning the
elements in the
tree into formatting object nodes and the
attributes into property specifications. The result of this step is
the <term>formatting object tree</term>.
</p>
<figure>
<graphic source="tree2-3.gif" alt="Objectification of the FO tree" longdesc="Diagram showing how the Formatting Objects tree is 'objectified': new nodes are created as characters are converted to character FOs." xml:attributes="href source" show="embed" actuate="auto" xmlns:xlink="http://www.w3.org/TR/WD-xlink"/>
<figcap><p>Build the XSL Formatting Object Tree</p></figcap>
</figure>
<p>
As part of the step of objectifying, the characters that occur in
the result tree are replaced by fo:character nodes.
<spot id="fo_12"/>Characters in text nodes which consist
solely of <spot id="jm010109_7bf"/>white space characters and
which are children of elements whose corresponding formatting objects do
not permit fo:character nodes as children are ignored.  Other characters
within elements whose corresponding formatting objects do not permit
fo:character nodes as children are errors.

</p>
<p><spot id="fo01jr_3c"/>The content of the fo:instream-foreign-object
is not objectified;
instead the object representing the fo:instream-foreign-object
element points to the appropriate node in the element and
attribute tree.
<spot id="wai_4f"/>Similarly any non-XSL namespace child element
of fo:declarations is not objectified; instead the object representing
the fo:declarations element points to the appropriate node in the
element and attribute tree.
</p>
<p>
The second phase in formatting is to refine the formatting
object tree
to produce the <term>refined formatting object tree</term>.
The refinement process handles the mapping from properties
to traits.  This consists of: (1) shorthand expansion into
individual properties, (2) mapping of corresponding
properties, (3) determining computed values (may include
expression evaluation),
(4) handling white-space-treatment and linefeed-treatment
property effects, and (5) inheritance.
Details on
refinement are found in <specref ref="refinement"/>.
</p>
<p>The refinement step is depicted in the diagram below.
</p>
<figure>
<graphic source="tree3-4.gif" alt="Refinement of the FO tree" longdesc="Diagram showing the refinement process of the FO tree: traits are computed from properties using the inheritance model and evaluation of expressions." xml:attributes="href source" show="embed" actuate="auto" xmlns:xlink="http://www.w3.org/TR/WD-xlink"/>
<figcap><p>Refine the Formatting Object Tree</p></figcap>
</figure>
<p>
The third step in formatting is the construction of the area
tree. The
area tree is generated as described in the semantics of each
formatting object. The traits applicable to each formatting
object
class control how the areas are generated. Although every
formatting property may be specified on every formatting object, for
each formatting object class, only a subset of the formatting
properties are used to determine the traits for objects of
that class.
</p>
<p>Area generation is depicted in the diagram below.<spot id="aj000035_2"/>
</p>
<figure>
<graphic source="trees4-5.gif" alt="Area tree generation" longdesc="This figure shows the last step in the XSL process: a source tree of FOs transforms into a result tree of areas which is rendered on various devices (printer, phone, screen)." xml:attributes="href source" show="embed" actuate="auto" xmlns:xlink="http://www.w3.org/TR/WD-xlink"/>
<figcap><p>Generate the Area Tree</p></figcap>
</figure>
<figure>
<graphic source="process-sum.gif" alt="FO-to-area process summary" longdesc="This diagram summarizes the XSL process for a sample formatting object block and two attributes: objectification turns the block element to the block FO and its attributes into properties. After refinement, properties become traits (units are normalized), and the last step makes a block area from the block FO." xml:attributes="href source" show="embed" actuate="auto" xmlns:xlink="http://www.w3.org/TR/WD-xlink"/>
<figcap><p>Summary of the Process</p></figcap>
</figure>
</div3>
</div2>
<div2><head>Benefits of XSL</head>
<p>Unlike the case of HTML, element names in XML have no intrinsic
presentation semantics. Absent a stylesheet, a processor could not
possibly know how to render the content of an XML document other
than as an undifferentiated string of characters. XSL provides
a comprehensive model and a vocabulary for writing such stylesheets using XML syntax.
</p>
<p>
This document is intended for implementors of such XSL processors.
Although it can be used as a reference manual for writers of XSL
stylesheets, it is not tutorial in nature. </p>
<p>
XSL builds on the prior work on Cascading Style Sheets
<bibref ref="CSS2"/> and
the Document Style Semantics and Specification Language
<bibref ref="DSSSL"/>.
While many of XSL's formatting objects and properties correspond
to the common set of properties, this would not be
sufficient by
itself to accomplish all the goals of XSL. In particular, XSL introduces
a model for pagination and layout that extends what is currently available
and that can in turn be extended, in a straightforward way, to page
structures beyond the simple page models described in this specification.
</p><div3><head>Paging and Scrolling</head>
<p>Doing both scrollable document windows and pagination introduces
new complexities to the styling (and pagination) of XML content.
Because pagination introduces arbitrary boundaries
(pages or regions on pages) on the content, concepts such as
the control
of spacing at page, region, and block boundaries become
extremely important. There are also concepts related to
adjusting the spaces between lines (to adjust the page
vertically)
and between words and letters (to justify the lines of text).
These do not always arise with simple scrollable document
windows, such as those found in today's browsers. However, there
is a correspondence between a page with multiple regions, such as a body,
header, footer, and left and right <spot id="c11i14_a"/>sidebars, and a Web
presentation using "frames". The distribution of content into the regions
is basically the same in both cases, and XSL handles both
cases in an analogous fashion.</p>
<p>
XSL was developed to give designers control over the features
needed when documents are paginated as well as to provide an
equivalent "frame" based structure for browsing on the Web.
To achieve this control, XSL has extended the set of formatting
objects and formatting properties. In addition, the selection
of XML source components that can be styled (elements,
attributes, text nodes, comments, and processing
instructions) is based on XSLT and
XPath <spot id="jm010109_28"/><bibref ref="XPATH"/>,
thus providing the
user with an extremely powerful selection mechanism. </p>
<p>
The design of the formatting objects and properties extensions
was first inspired by DSSSL. The actual extensions, however, do not
always look like the DSSSL constructs on which they were based. To either
conform more closely with the CSS2 specification or to
handle cases more simply than in DSSSL, some extensions have diverged from DSSSL.
</p><p>
There are several ways in which extensions were made. In some cases,
it sufficed to add new values, as in the case of those added to reflect
a variety of writing-modes, such as top-to-bottom and bottom-to-top, rather
than just left-to-right and right-to-left.
</p><p>
In other cases, common properties that are expressed in CSS2
as one property with multiple simultaneous values, are split into
several new properties to provide independent control over independent
aspects of the property. For example, the "white-space" property was
split into four properties:
a <spot id="od000138_2b"/>"white-space-treatment" property that
controls how <spot id="jm010109_7be"/>white space is processed, a <spot id="aj000035_3"/>"linefeed-treatment" property that controls
how <spot id="jm010109_29"/>line feeds are processed,
a "white-space-collapse" property that controls
how multiple consecutive spaces are collapsed,
and a "wrap-option" property
that controls whether lines are automatically wrapped when
they encounter a boundary, such as the edge of a column.
The effect of splitting a property into two or more
(sub-)properties is to make the equivalent existing CSS2
property a "shorthand" for the set of sub-properties it subsumes.
</p><p>
In still other cases, it was necessary to create new properties.
For example, there are a number of new properties that control how
hyphenation is done. These include identifying the script and country
the text is from as well as such properties as "hyphenation-character"
(which varies from script to script).
</p><p>
Some of the formatting objects and many of the properties in XSL
come from the CSS2 specification, ensuring compatibility
between the two.</p>
<p>
There are four classes of XSL properties that can be identified as:</p>
<olist><item><p>
CSS properties by copy (unchanged from their CSS2
semantics)</p></item>
<item><p>
CSS properties with extended values</p></item>
<item><p>
CSS properties broken apart and/or extended</p></item>
<item><p>
<spot id="c11i15"/>XSL-only properties</p></item></olist>
</div3>
<div3><head>Selectors and Tree Construction</head>
<p>
As mentioned above, XSL uses XSLT and XPath for tree construction
and pattern selection, thus providing a high degree of control
over how portions of the source content are presented, and what
properties are associated with those content portions, even where
mixed namespaces are involved.
</p><p>
For example, the patterns of XPath allow the selection of a portion
of a string or the Nth text node in a paragraph. This allows
users to have a rule that makes all third paragraphs in
procedural steps appear in bold, for instance. In addition,
properties can be associated with a content portion based on the
numeric value of that content portion or attributes on the
containing element. This allows one to have a style rule
that makes negative values appear in "red" and positive
values appear in "black". Also, text can be generated
depending on a particular context in the source tree,
or portions of the source tree may be presented
multiple times with different styles.
</p></div3>
<div3><head>An Extended Page Layout Model</head>
<p>
There is a set of formatting objects in XSL to describe both the
layout structure of a page or "frame"
(how big is the body; are there multiple columns;
are there headers, footers, or <spot id="c11i14_b"/>sidebars; how big are these)
and the rules by which the XML source content is placed into these "containers".
</p><p>
The layout structure is defined in terms of one or more instances
of a "simple-page-master" formatting object. This formatting
object allows one to define independently filled regions for
the body (with multiple columns), a header, a footer, and <spot id="c11i14_c"/>sidebars
on a page. These simple-page-masters can be used in page sequences
that specify in which order the various simple-page-masters shall be used.
The page sequence also specifies how styled content is to fill those pages.
This model allows one to specify a sequence of simple-page-masters
for a book chapter where the page instances are automatically
generated by the formatter or an explicit sequence of pages
such as used in a magazine layout. Styled content is assigned
to the various regions on a page by associating the name of the
region with names attached to styled content in the result tree.
</p><p>
In addition to these layout formatting objects and properties,
there are properties designed to provide the level of control
over formatting that is typical of paginated documents.
This includes control over hyphenation, and expanding the control over
text that is kept with other text in the same line, column,
or on the same page.
</p></div3>
<div3><head>A Comprehensive Area Model</head>
<p>
The extension of the properties and formatting objects,
particularly in the area on control over the spacing of blocks, lines,
and page regions and within lines, necessitated an extension of the
CSS2 box formatting model. This extended model is described
in <specref ref="area_model"/> of this
specification. The CSS2 box model is a
subset of this model.  See the mapping of the CSS2 box model
terminology to the XSL Area Model terminology in
<specref ref="cssbox"/>.
The area model provides a vocabulary for describing
the relationships and space-adjustment between
letters, words, lines, and blocks.</p>
</div3>
<div3><head>Internationalization and Writing-Modes</head>
<p>
There are <spot id="i18n_2"/>some scripts, in particular in the Far East, that are
typically set with words proceeding from top-to-bottom and
lines proceeding either from right-to-left (most common) or
from left-to-right. Other directions are also
used. Properties expressed in terms of a fixed,
absolute frame of reference (using top, bottom, left, and right)
and which apply only to a notion of words proceeding from left to right
or right to left do not generalize well to
<spot id="i18n_4"/>text written in those scripts.
</p><p>
For this reason XSL (and before it DSSSL) uses a relative frame of
reference for the formatting object and property descriptions. Just as
the CSS2 frame of reference has four directions (top, bottom, left and right),
so does the XSL relative frame of reference have four directions
(before, after, start, and end), but these are relative to the "writing-mode". The
"writing-mode" property is a way of controlling the
directions needed by a formatter to correctly place
glyphs, words, lines, blocks, etc. on the page or screen.
The "writing-mode" expresses the basic directions noted
above. 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. <spot id="c11i16"/>See <specref ref="writing-mode"/>
for the description of the "writing-mode" property.
Typically, the writing-mode value specifies two directions:<spot id="c11i17"/>
the first is the inline-progression-direction which determines
the direction in which words will
be placed and the second is the block-progression-direction
which determines the direction in which blocks (and lines)
are placed one after another.
<spot id="i18n_5"/>In addition, the inline-progression-direction
for a sequence of characters may be implicitly determined using
bidirectional character types for those characters from the
Unicode Character Database  <bibref ref="UNICODE-CD"/>
for those characters and the Unicode <spot id="jm010109_11b"/>bidirectional (BIDI) algorithm <bibref ref="UNICODE-TR9"/>.
</p>
<p>
Besides the directions that are explicit in the name of the
value of the "writing-mode" property, the writing-mode determines
other directions needed by the formatter, such as the
shift-direction (used for <spot id="jm010109_30a"/>subscripts and superscripts), etc.
</p></div3>
<div3><head>Linking</head>
<p>
Because XML, unlike HTML, has no built-in semantics,
there is no built-in notion of a hypertext link.
<spot id="link01_i3"/>In this context, "link" refers
to "hypertext link" as defined in
<xspecref href="http://www.w3.org/TR/html401/struct/links.html#h-12.1" show="new" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">http://www.w3.org/TR/html401/struct/links.html#h-12.1</xspecref>
as well as some of the aspects of "link" as defined in
<xspecref href="http://www.w3.org/TR/xlink/#intro" show="new" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">http://www.w3.org/TR/xlink/#intro</xspecref>,
where "link is a relationship between two or more resources or
portions of resources, made explicit by an XLink linking element".
Therefore,
XSL has a formatting object that expresses the dual semantics of
formatting the content of the link reference and the
semantics of following the link.</p>
<p>
XSL provides a few mechanisms for changing the presentation
of a link target that is being visited. One of these mechanisms
permits indicating the link target as such;
another allows for control over the placement of the link
target in the viewing area; still another permits some degree of
control over the way the link target is displayed in relationship
to the originating link anchor.</p>
<p>XSL also provides a general mechanism for changing the way elements
are formatted depending on their active state. This is particularly
useful in relation to links, to indicate whether a given link
reference has already been visited, or to apply a given style
depending on whether the mouse, for instance, is hovering over
the link reference or not.</p>
</div3>
</div2>
</div1>


<div1><head><spot id="jm010109_2"/>XSL Transformation</head>
<div2>
<head>Tree Construction</head>
<p>The Tree Construction is described in
"XSL Transformations" <bibref ref="XSLT"/>.</p>
<p>The provisions in "XSL Transformations" form an integral part of
this <spot id="jm010109_10a"/>Recommendation and are considered normative.</p>
</div2>

<div2 id="xsl-namespace">
<head>XSL Namespace</head>

<p>The XSL namespace has the URI <code>http://www.w3.org/1999/XSL/Format</code>.</p>
<note><p>The <code>1999</code> in the URI indicates the year in which
the URI was allocated by the W3C.  It does not indicate the version of
XSL being used.</p></note>
<p>XSL processors must use the XML namespaces mechanism <bibref ref="XMLNAMES"/> to recognize elements and attributes from this
namespace. Elements from the XSL namespace are recognized only in the
stylesheet, not in the source document.
Implementors must not extend the XSL
namespace with additional elements or attributes. Instead, any
extension must be in a separate namespace.</p>
<p>This specification uses the prefix <code>fo:</code> 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.</p>
<p>An element from the XSL namespace may have any attribute not from
the XSL namespace, provided that the <xtermref href="http://www.w3.org/TR/xpath#dt-expanded-name" show="new" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">expanded-name</xtermref> of the
attribute has a non-null namespace URI.  The presence of such
attributes must not change the behavior of XSL elements and functions
defined in this document. Thus, an XSL processor is always free to
ignore such attributes, and must ignore such attributes without giving
an error if it does not recognize the namespace URI. Such attributes
can provide, for example, unique identifiers, optimization hints, or
documentation.</p>
<p>It is an error for an element from the XSL namespace to have
attributes with expanded-names that have null namespace URIs
(i.e., attributes with unprefixed names) other than
attributes defined for the element in this document.</p>
<note><p>The conventions used for the names of XSL elements,
attributes, and functions are as follows:
names are all <spot id="c11i18"/>lowercase,
hyphens are used to separate words, dots are used to
separate names for the components of complex datatypes,
and abbreviations are used only if they already
appear in the syntax of a related language such as XML or
HTML.</p></note>

</div2>

</div1>


<div1 id="fo-jc-intro"><head>Introduction to Formatting</head>
<p>The aim of this section is to describe the general process
of formatting, enough to read the area model and the
formatting object descriptions and properties and to
understand the process of refinement.</p>
<p><emph>Formatting</emph> is the process of turning the result of an XSL
transformation into a tangible form for the reader or listener. This
process comprises several steps, some of which depend on others in a
non-sequential way.
Our model for formatting will be the construction of an
<term>area tree</term>, which is 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 information is referred to under the rubric of
<emph>traits</emph>, which are to areas what properties are to formatting objects
and attributes are to XML <spot id="aj000035_4"/>elements.
<specref ref="area_model"/> will
describe the area tree and
define the default placement-constraints on stacked areas. However, this is
an abstract model which need not be actually implemented in this way
in a formatter, so long as the resulting tangible form obeys the implied constraints.
Constraints might conflict to the point where it is
impossible to satisfy them all.  In that case, it is
implementation-defined which constraints should be relaxed
and in what order to satisfy the others.
</p>
<p><emph>Formatting objects</emph> are elements in the formatting object tree, whose
names are from the XSL namespace; a formatting object belongs to a
<emph>class</emph> of formatting objects identified by its element name. The
formatting behavior of each class of formatting objects is described in
terms of what areas are created by a formatting object of that class, how
the traits of the areas are established, and how the areas are
structured hierarchically with respect to areas created by other formatting
objects. <specref ref="fo-section"/> and
<specref ref="pr-section"/><spot id="aj000029_19a"/>
describe formatting objects and their properties.</p>
<p>Some formatting objects are <emph>block-level</emph> and others are
<emph>inline-level</emph>. This refers to the types of areas which they generate,
which in turn refer to their default placement method. Inline-areas (for
example, glyph-areas) are collected into lines and the direction in which
they are stacked is the inline-progression-direction. Lines are a type of
block-area and these are stacked in a direction perpendicular to the
inline-progression-direction, called the block-progression-direction. See
<spot id="c11i1_a"/><specref ref="area_model"/> for detailed decriptions
of these area types and directions.</p>
<p>In Western writing systems, the block-progression-direction is
"top-to-bottom" and the inline-progression-direction is
"left-to-right". This specification treats other writing systems
as well and introduces the terms "block" and "inline"
instead of using absolute indicators like "vertical" and
"horizontal". Similarly this specification tries to give
relatively-specified directions ("before" and "after"
in the block-progression-direction, "start" and "end"
in the inline-progression-direction) where appropriate, either in addition
to or in place of absolutely-specified directions such as "top",
"bottom", "left", and "right". These are
interpreted according to the value of the writing-mode property.</p>
<p>Central to this model of formatting is <emph>refinement</emph>.
This is a computational
process which finalizes the specification of properties based on the attribute
values in the XML result tree. Though the XML result tree and the formatting object
tree have very similar structure, it is helpful to think of them as
separate conceptual entities. Refinement involves</p>
<ulist><item><p>propagating the various inherited values
of properties (both implicitly and those with an attribute value of "inherit"),
</p></item>
<item><p>evaluating expressions in property value specifications into actual
values, which
are then used to determine the value of the properties,<spot id="c11i20_a"/></p></item>
<item><p>converting relative numerics to absolute numerics,</p></item>
<item><p>constructing some composite properties from more than one attribute<spot id="c11i20_b"/></p></item>
</ulist>
<p>Some of these operations (particularly evaluating expressions) depend on knowledge
of the area tree. Thus refinement is not necessarily a straightforward, sequential
procedure, but may involve look-ahead, back-tracking, or control-splicing with
other processes in the formatter. Refinement is described more fully in
<spot id="c11i1_b"/><specref ref="refinement"/>.</p>
<p>To summarize, formatting proceeds by constructing an area tree
(containing areas and their traits) which satisfies constraints based on
information contained in the XML result tree (containing
element nodes and their
attributes). Conceptually, there are intermediate steps of
constructing a formatting object tree (containing formatting objects and their
properties) and refinement;
these steps may proceed in an interleaved fashion during the
construction of the area tree.</p>
<div2><head>Conceptual Procedure</head>
<p>This subsection contains a conceptual description of how
formatting could work. This conceptual
procedure does not mandate any particular algorithms or data structures as
long as the result obeys the implied constraints.</p>
<p>The procedure works by processing formatting objects. Each object,
while being processed, may initiate processing in other objects. While the
objects are hierarchically structured, the processing is not; processing of
a given object is rather like a co-routine which may pass control to other
processes, but pick up again later where it left off. The procedure starts
by initiating the processing of the fo:root
formatting object.</p>
<p>Unless otherwise specified, processing a formatting object creates areas
and returns
them to its parent to be placed in the area tree. Like a co-routine, it
resumes control later and initiates formatting of its own children (if
any), or some subset of them. The formatting object supplies parameters to its
children
based on the traits of areas already in the area tree, possibly including
areas generated by the formatting object or its ancestors. It then disposes of the
areas
returned by its formatting object children. It might simply
return such an area to its
parent (and will always do this if it does not generate areas itself), or
alternatively it might arrange the area in the area tree according to the
semantics of the formatting object; this may involve changing its geometric position.
It
terminates processing when all its children have terminated processing (if
initiated) and it is finished generating areas.</p>
<p>Some formatting objects do not themselves generate areas;<spot id="c11i21"/> instead these
formatting objects simply
return the areas returned to them by their children. Alternatively, a formatting object
may continue to generate (and return) areas based on information discovered
while formatting its own children; for example, the fo:page-sequence formatting object
will continue generating pages as long as it contains a flow with
unprocessed descendants.</p>
<p>Areas returned to an fo:root formatting object are
page-viewport-areas, and are simply placed as
children of the area tree root in the order in which they are returned,
with no geometrical implications.</p>
<p>As a general rule, the order of the area tree parallels the order of the
formatting object tree. That is, if one formatting object
precedes another in the depth-first
traversal of the formatting object tree, with neither
containing the other, then
all the areas generated by the first will precede all the areas generated
by the second in the depth-first traversal of the area tree, unless
otherwise specified. Typical exceptions to this rule would be things like
side floats, before floats, and footnotes.</p>
<p>At the end of the procedure, the areas and their traits have been
constructed, and they are required to satisfy constraints described in the
definitions of their associated formatting objects, and in the area model
section. In particular, size and position of the areas will be subject to
the placement and spacing constraints described in the area model, unless
the formatting object definition indicates otherwise.</p>
<p>The formatting object definitions, property descriptions, and area model
are not algorithms. Thus, the formatting object semantics do not specify how
the line-breaking algorithm must work in collecting characters into words,
positioning words within lines, shifting lines within a container, etc.
Rather this specification assumes that the formatter has done these things
and describes the constraints which the result is supposed to
satisfy.</p>
</div2>
</div1>




<div1 id="area_model"><head>Area Model</head>
<p>In XSL, one creates a tree of formatting objects that serve as inputs or
specifications to a formatter. The formatter generates a hierarchical arrangement
of areas which comprise the formatted result. This section defines the general
model of areas and how they interact. The purpose is to present an abstract
framework which is used in describing the semantics of formatting objects.
It should be seen as describing a series of constraints for
conforming implementations,
and not as prescribing particular algorithms.</p>
<div2 id="area-intro"><head>Introduction</head>
<p>The formatter generates an ordered tree, the <term>area tree,</term> which
describes a geometric structuring of the output medium. The terms
<term>child, sibling, parent, descendant,</term> and <term>ancestor</term>
refer to this tree structure. The tree has a <term>root node</term>.</p>
<p>Each area tree node other than the root is called an <term>area</term> and 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.</p>
<note><p>The only exceptions are when several leaf nodes of the formatting object
tree are combined
to generate a single area, for example when several characters
in sequence generate a single ligature
glyph. In all such cases, relevant properties such as
<trait>font-family</trait> and <trait>font-size</trait> are the same for
all the generating formatting objects (see section <specref ref="area-linebuild"/>).</p></note>
<p>An area has a <term>content-rectangle</term>,
the portion in which its child areas are assigned, and optional
<term>padding</term> and <term>border</term>. The diagram shows
how these portions are related to one another. The outer bound of the border
is called the <term>border-rectangle</term>, and the outer
bound of the
padding is called the <term>padding-rectangle</term>.</p>
<graphic source="RectsOnlyForModel.gif" alt="Elements of an area" longdesc="Nested rectangles showing the components of an area: innermost is the content rectangle, nested within the padding rectangle, itself nested within the border rectangle." xml:attributes="href source" show="embed" actuate="auto" xmlns:xlink="http://www.w3.org/TR/WD-xlink"/>
<p>Each area has a set of <term>traits</term>, a mapping of names to values,
in the way elements have attributes and formatting objects have properties.
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 <term>formatting traits</term>, and traits used for
rendering may be called <term>rendering traits</term>.
Traits whose values are copied or derived from <spot id="aj000029_22a"/>a property
of the same or a corresponding
name are listed in <specref ref="property-index"/> and <specref ref="refinement"/>;
other traits are listed below.</p>
<note><p>Traits are also associated with FOs during the process of refinement.
Some traits are assigned during formatting, while others are already present after
refinement.</p></note>
<p>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.)</p>
<p>The traits of an area are either:</p>
<p><term>directly-derived</term>: the values of directly-derived traits are the computed
value of a property of the same or a corresponding name on the generating formatting object, or</p>
<p><term>indirectly-derived</term>: the values of indirectly-derived traits are the
result of a computation involving the computed values of one or more properties
on the generating formatting object, other traits on this area or other
interacting areas (ancestors, parent, siblings, and/or children) and/or
one or more values constructed by the formatter. The calculation formula
may depend on the type of the formatting object.</p>
<p>This description assumes that refined values have been computed for all
properties of formatting objects in the result tree, i.e.,
all relative and corresponding values have been computed and the inheritable
values have been propagated as described in <specref ref="refinement"/>. This
allows the
process of inheritance to be described once and avoids a need to repeat
information on computing values
in this description.</p>
<p>The indirectly-derived traits are:
<trait>block-progression-direction</trait>,
<trait>inline-progression-direction</trait>,
<trait>shift-direction</trait>,
<trait>glyph-orientation</trait>,
<trait>is-reference-area</trait>,
<trait>is-viewport-area</trait>,
<trait>left-position</trait>,
<trait>right-position</trait>,
<trait>top-position</trait>,
<trait>bottom-position</trait>,
<trait>left-offset</trait>,
<trait>top-offset</trait>,
<trait>is-first</trait>,
<trait>is-last</trait>,
<trait>alignment-point</trait>,
<trait>area-class</trait>,
<trait>start-intrusion-adjustment</trait>,
<trait>end-intrusion-adjustment</trait>,
<trait>generated-by</trait>,
<trait>returned-by</trait>,
<trait>page-number</trait>,
<trait>blink</trait>,
<trait>underline-score</trait>,
<trait>overline-score</trait>,
<trait>through-score</trait>,
<trait>underline-score-color</trait>,
<trait>overline-score-color</trait>,
<trait>through-score-color</trait>,
<trait>alignment-baseline</trait>,
<trait>baseline-shift</trait>,
<trait>nominal-font</trait>,
<trait>dominant-baseline-identifier</trait>,
<trait>actual-baseline-table</trait>, and
<trait>script</trait>.
</p>
</div2>
<div2 id="area-rect"><head>Rectangular Areas</head>
<div3><head>Area Types</head>
<p>There are two types of areas: <term>block-areas</term> and
<term>inline-areas</term>. These differ according to how
they are typically stacked by the formatter. 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. Although block-areas and inline-areas are
typically stacked, some areas can be explicitly positioned.</p>
<p>A <term>line-area</term> is a special kind of block-area whose children
are all inline-areas. A <term>glyph-area</term> is a special kind of
inline-area which has no child areas, and has a single
glyph image as its content.</p>
<p>Typical examples of areas are: 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).</p>
</div3>
<div3 id="area-common"><head>Common Traits</head>
<p>Associated with any area are two directions, which are derived from the
generating
formatting object's <trait>writing-mode</trait> and
<trait>reference-orientation</trait> properties: the
<term>block-progression-direction</term> is the direction for stacking block-area
descendants of the area, and the
<term>inline-progression-direction</term> is the direction for stacking inline-area
descendants of the area. Another
trait, the <term>shift-direction</term>, is present on inline-areas and refers to
the direction in which baseline
shifts are applied. Also the <term>glyph-orientation</term> defines the orientation
of glyph-images in the rendered result.</p>

<p>If the reference-orientation for an area is 0, then the
top, bottom, left, and right edges of the content are parallel to those of
the area's parent and consistent with them. Otherwise the edges are rotated
from those of the area's parent as described in <specref ref="reference-orientation"/>.
The inline-progression-direction and block-progression-direction are determined
by the location of these edges as described in <specref ref="writing-mode"/>.</p>

<p>The Boolean trait <trait>is-reference-area</trait> determines
whether or not an area establishes a coordinate system for
specifying indents. An area for which this trait is <code role="value">true</code>
is called a <term>reference-area</term>.
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.</p>

<p>The Boolean trait <trait>is-viewport-area</trait> determines
whether or not an area establishes an opening through which its
descendant areas can be viewed, and can be used to
present clipped or scrolled material; for example, in printing
applications where bleed and trim is desired.
An area for which this trait is <code role="value">true</code>
is called a <term>viewport-area</term>.
</p>
<p>A common construct is a <term>viewport/reference pair</term>.
This is a <spot id="jc-20010515-remove-block"/>
viewport-area <var>V</var> and a block-area
reference-area <var>R</var>, where <var>R</var> is the sole child
of <var>V</var> and where the start-edge and end-edge of the
content-rectangle of <var>R</var> are parallel to the start-edge and
end-edge of the content-rectangle of <var>V</var>.</p>

<p>Each area has the traits <term>top-position</term>, <term>bottom-position</term>,
<term>left-position</term>, and <term>right-position</term> which represent the distance
from the edges of its content-rectangle to the like-named edges of the
nearest ancestor reference-area (or the page-viewport-area
in the
case of areas generated by descendants of formatting objects
whose absolute-position is <code role="value">fixed</code>); the <term>left-offset</term>
and <term>top-offset</term> determine the amount by which
a relatively-positioned area is shifted for rendering.  These traits receive
their values during the formatting process, or in the case
of absolutely positioned areas, during refinement.</p>
<p>The <term>block-progression-dimension</term> and
<term>inline-progression-dimension</term> of an area represent the
extent of the content-rectangle of that area in each of the two
relative <spot id="aj000029_23a"/>dimensions.</p>

<p>Other traits include:</p>
<ulist><item>
<p>the <trait>is-first</trait> and <trait>is-last</trait> traits, which are Boolean traits
indicating the order in which areas are generated and returned by a given
formatting object.
<spot id="jc-20010515-returned-order"/>(See <specref ref="define-returned-by"/>.
<trait>is-first</trait> is <code role="value">true</code>
for the first area (or only area) generated and returned by a formatting object,
and <trait>is-last</trait>
is <code role="value">true</code> for the last area (or only area));</p></item>
<item>
<p>the amount of space outside the border-rectangle: <term>space-before</term>,
<term>space-after</term>, <term>space-start</term>, and <term>space-end</term>
(though some of these may be required to be zero on certain classes of area);</p>
<note><p>"Before", "after", "start",
and "end" refer to relative directions and are defined
below.</p></note>
</item>
<item><p>the thickness of each of the four sides of the padding: <term>padding-before</term>,
<term>padding-after</term>, <term>padding-start</term>, and <term>padding-end</term>;</p></item>
<item><p>the style, thickness, and color of each of the
four sides of the border: <term>border-before</term>, etc.;</p></item>
<item><p>the background rendering of the
area: <term>background-color</term>, <term>background-image</term>, and
other background traits; and</p>
</item><item>
<p>the <trait>nominal-font</trait> for an area, as
determined by the font properties and the character descendants of the
area's generating formatting object.
(see <specref ref="fontprops"/>)<spot id="jm010109_31"/></p></item>
</ulist>
<p>Unless otherwise specified, the traits of a
formatting object are present on each of its generated areas,
and with the same value. (However, see sections
<specref ref="area-linebuild"/> and <specref ref="rend-border"/>.)</p>
</div3>
<div3 id="area-geo"><head>Geometric Definitions</head>
<p>As described above, the <term>content-rectangle</term> is the rectangle
bounding the inside of the padding and is used to describe
the constraints on the positions of descendant areas. It is possible that
marks from descendant glyphs or other areas may appear outside the
content-rectangle.</p>
<p>Related to this is the <term>allocation-rectangle</term>
of an area,
which is used to describe the constraints on the position of
the area within its parent area. For an inline-area this is either the
<term>normal-allocation-rectangle</term> or the <term>large-allocation-rectangle</term>.
The <term>normal-allocation-rectangle</term>
extends
to the content-rectangle
in the block-progression-direction and to the border-rectangle in the
inline-progression-direction. The <term>large-allocation-rectangle</term>
is the border-rectangle. Unless
otherwise specified, the allocation-rectangle for an area is the
normal-allocation-rectangle.
</p>
<figure>
<graphic source="AllocationRectInline.4.gif" alt="Normal-allocation-rectangle of an inline-area" longdesc="This diagram shows the position of the normal allocation rectangle of an inline area, as described in the text." xml:attributes="href source" show="embed" actuate="auto" xmlns:xlink="http://www.w3.org/TR/WD-xlink"/>
<figcap><p>Normal-allocation-rectangle of an inline-area</p></figcap>
</figure>
<figure>
<graphic source="AllocationRectInline-Large.gif" alt="Large-allocation-rectangle of an inline-area" longdesc="This diagram shows the position of the large allocation rectangle of an inline area, which is the same at the border rectangle." xml:attributes="href source" show="embed" actuate="auto" xmlns:xlink="http://www.w3.org/TR/WD-xlink"/>
<figcap><p><spot id="jm010063_1"/>Large-allocation-rectangle of an inline-area</p></figcap>
</figure>
<p>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 <trait>end-indent</trait>,
and in the opposite direction by an amount equal to the <trait>start-indent</trait>.</p>
<note><p>The inclusion of space outside the border-rectangle of a block-area
in the inline-progression-direction does not affect
placement constraints, and
is intended to promote compatibility with the CSS box model.</p></note>
<figure>
<graphic source="AllocationRect.2.gif" alt="Allocation- and content-rectangles of a block-area" longdesc="This diagram shows the position of the allocation rectangle of a block area, as described in the text." xml:attributes="href source" show="embed" actuate="auto" xmlns:xlink="http://www.w3.org/TR/WD-xlink"/>
<figcap><p>Allocation- and content-rectangles of a block-area</p></figcap>
</figure>
<p>The edges of a rectangle are designated as follows:</p>
<ulist><item>
<p>the <term>before-edge</term> is the edge occurring first in the
block-progression-direction and perpendicular
to it;</p></item>
<item><p>the <term>after-edge</term> is the edge opposite
the before-edge;</p></item>
<item><p>the <term>start-edge</term> is the edge occurring
first in the inline-progression-direction and perpendicular
to it,</p></item>
<item><p>the <term>end-edge</term> is the edge opposite the
start-edge.</p></item></ulist>
<p>For purposes of this definition, the content-rectangle of an area uses the
inline-progression-direction and block-progression-direction of that area;
but the border-rectangle, padding-rectangle, and
allocation-rectangle use the
directions of its parent area. <spot id="edges_may_not_correspond"/>Thus the edges designated for the
content-rectangle may not correspond to the same-named edges
on the padding-, border-,
and allocation-rectangles. This is important in the case of
nested block-areas with different writing-modes.</p>
<p>The following diagram shows the correspondence between the various edge
names for a mixed writing-mode example:</p>
<graphic source="japaneseblock3.gif" alt="Embedded areas with different writing-modes" longdesc="Example of nested areas with different writing modes: a block with English text (writing mode: left-to-right, top-to-bottom) contains a block with Japanese text (writing-mode: top-to-bottom, right-to-left). The position of relative edges (start, end, before and after) is shown on each area." xml:attributes="href source" show="embed" actuate="auto" xmlns:xlink="http://www.w3.org/TR/WD-xlink"/>

<p>Each inline-area has an <term>alignment-point</term> determined by the formatter,
on the start-edge
of its allocation-rectangle; for a glyph-area, this is
a point on the start-edge of the glyph on its alignment baseline (see below).
This is script-dependent and does not necessarily correspond to the
(0,0) coordinate point used for the data describing the glyph shape.</p>
</div3>
<div3 id="area-treeorder"><head>Tree Ordering</head>
<p>In the area tree, the set of areas with a given parent is ordered.
The terms <term>initial, final, preceding</term>, and
<term>following</term> refer to this ordering.</p>

<p>In any ordered tree, this sibling order extends to an ordering of the entire tree
in at least two ways.</p>
<ulist><item><p>In the <term>pre-order traversal order</term> of a tree, the children
of each node (their order unchanged relative to one another) follow the node, but
precede any following siblings of the node or of its ancestors.</p></item>
<item><p>In the <term>post-order traversal order</term> of a tree, the children of
each node precede the node, but follow any preceding siblings of the node or of its
ancestors.</p></item></ulist>
<p>"Preceding" and "following", when applied to non-siblings, will depend on the
extension order used, which must be specified. However, in either of these given orders,
the leaves of the tree (nodes without children) are unambiguously ordered.</p>
</div3>

<div3 id="area-stackcon"><head>Stacking Constraints</head>
<p>This section defines the notion of <term>block-stacking constraints</term> and
<term>inline-stacking constraints</term> involving areas. These are defined as
ordered relations, i.e., if <var>A</var> and <var>B</var>
have a stacking constraint
it does not necessarily mean that <var>B</var> and <var>A</var> have a stacking
constraint. These definitions are recursive in nature and some cases may depend
upon simpler cases of the same definition. This is not circularity but rather a
consequence of recursion. The intention of the
definitions is to identify areas at any level of the
tree which have only space between them.</p>
<p>The <trait>area-class</trait> trait is an enumerated value which is
<code role="value">xsl-normal</code> for an area which is stacked with
other areas in sequence.  A <term>normal</term> area is an
area for which this trait is <code role="value">xsl-normal</code>. A
<term>page-level-out-of-line</term>
area is an area with area-class <code role="value">xsl-footnote</code>,
<code role="value">xsl-before-float</code>,
or <code role="value">xsl-fixed</code>; placement of these areas is controlled
by the fo:page-sequence
ancestor of its generating formatting object.  A <term>reference-level-out-of-line</term>
area is an area with area-class
<code role="value">xsl-side-float</code> or <code role="value">xsl-absolute</code>;
placement of these areas is controlled by the formatting object generating
the relevant reference-area.   An <term>anchor</term>
area is an area with area-class
<code role="value">xsl-anchor</code>;
placement of these areas is arbitrary and does not affect stacking.
Areas with area-class equal to one of
<code role="value">xsl-normal</code>,
<code role="value">xsl-footnote</code>, or
<code role="value">xsl-before-float</code> are defined to be
<term>stackable</term>,
indicating that they are supposed to be properly stacked.
</p>
<p><emph>Block-stacking constraints</emph></p>
<p>If <var>P</var> is a block-area, then there is a <term>fence preceding</term>
<var>P</var> if <var>P</var> is a reference-area or if the
border-before-width
or padding-before-width of <var>P</var> are non-zero.
Similarly, there is a
<term>fence following</term> <var>P</var> if <var>P</var> is a
reference-area
or if the border-after-width or padding-after-width of <var>P</var> are non-zero.</p>
<p>If <var>A</var> and <var>B</var> are stackable areas, and <var>S</var> is
a sequence of space-specifiers (see <specref ref="spacecond"/>),
it is defined that <term><var>A</var> and <var>B</var>
have block-stacking constraint <var>S</var></term> if
any of the following conditions holds:</p>
<olist>
<item><p><var>B</var> is a block-area which is the first normal
child of <var>A</var>, and <var>S</var> is the sequence consisting of the
space-before of <var>B</var>.</p></item>
<item><p><var>A</var> is a block-area which is the last normal
child of <var>B</var>, and <var>S</var> is the sequence consisting of the
space-after of <var>A</var>.</p></item>
<item><p><var>A</var> and <var>B</var> are both block-areas, and either</p>
    <p>a. <var>B</var> is the next stackable sibling area of <var>A</var>,
    and <var>S</var> is the sequence consisting of the space-after of <var>A</var>
    and the space-before of <var>B</var>;</p>

    <p>b. <var>B</var> is the first normal child of a block-area
    <spot id="jm010061"/><var>P</var>,
<var>B</var> is not a line-area,
    there is no fence preceding <var>P</var>,
<var>A</var> and
    <var>P</var> have a block-stacking constraint <var>S</var>', and <var>S</var>
    consists of <var>S</var>' followed by the space-before of <var>B</var>; or</p>
    <p>c. <var>A</var> is the last normal child of a block-area
    <var>P</var>,
<var>A</var> is not a line-area,
    there is no fence following <var>P</var>,
<var>P</var> and
    <var>B</var> have a block-stacking constraint <var>S</var>'', and <var>S</var>
    consists of the space-after of <var>A</var> followed by <var>S</var>''.</p>

   <p>d.
<spot id="jc-20010328-empties1"/>

<var>A</var> has a block-stacking constraint <var>S'</var> with a
    block-area <var>E</var>, <var>E</var> has a block-stacking constraint <var>S''</var>
    with <var>B</var>, <var>E</var> is
    <term>empty</term> (i.e., it has zero border,
    padding, and block-progression-dimension, and no normal children), and
    <var>S</var> consists of <var>S'</var> followed by
    <var>S''</var>.</p>

    </item>
</olist>
<note><p>The use of "stackable" in two places in the above definition allows
block-stacking constraints to apply between areas of area-class
<code role="value">xsl-before-float</code>
or <code role="value">xsl-footnote</code>.</p></note>
<figure>
<graphic source="block-stacking-constraints.gif" alt="Adjacent Edges with Block-stacking" longdesc="Five examples that illustrate each of the possible cases of block-stacking constraints listed above. In each case, the adjacent edge of the blocks is outlined." xml:attributes="href source" show="embed" actuate="auto" xmlns:xlink="http://www.w3.org/TR/WD-xlink"/>
<figcap><p>Adjacent Edges with Block-stacking</p></figcap>
</figure>
<p>When <var>A</var> and <var>B</var> have a block-stacking constraint, the
<term>adjacent edges</term> of <var>A</var> and <var>B</var> are an ordered
pair recursively defined as:</p>
<ulist><item><p>In case 1, the before-edge of the
content-rectangle of <var>A</var>
and the before-edge of the allocation-rectangle of <var>B</var>.</p></item>

<item><p><spot id="jm010062_1-2"/>In case 2, the after-edge of the allocation-rectangle
of <var>A</var> and
the after-edge of the content-rectangle of <var>B</var>.</p></item>
<item><p>In case 3a, the after-edge of the
allocation-rectangle of <var>A</var>
and the before-edge of the allocation-rectangle of <var>B</var>.</p></item>
<item><p>In case 3b, the first of the adjacent edges of <var>A</var> and <var>P</var>,
and the before-edge of the allocation-rectangle of <var>B</var>.</p></item>
<item><p>In case 3c, the after-edge of the
allocation-rectangle of <var>A</var>
and the second of the adjacent edges of <var>P</var> and <var>B</var>.</p></item>

<item><p>In
<spot id="jc-20010328-empties2"/>

case 3d, the first of the adjacent edges of <var>A</var> and <var>E</var>,
and the second of the adjacent edges of <var>E</var> and <var>B</var>.</p></item>

</ulist>


<p><emph>Example</emph>. In this diagram each node represents a block-area.

Assume that all padding
and border widths are zero, and none of the areas are
reference-areas. Then <var>P</var>
and <var>A</var> have a block-stacking constraint, as do <var>A</var>
and <var>B</var>, <var>A</var> and

<var>C</var>, <var>B</var> and <var>C</var>, <var>C</var> and <var>D</var>,
<var>D</var> and <var>B</var>,
<var>B</var> and

<var>E</var>, <var>D</var> and

<var>E</var>, and <var>E</var> and

<var>P</var>; these

are the only pairs  in the diagram having block-stacking constraints. If

<var>B</var> had non-zero padding-after, then <var>D</var>

and <var>E</var> would not have any block-stacking constraint (though <var>B</var>

and <var>E</var> would continue to have a block-stacking constraint).</p>

<figure>
<graphic source="mantree.gif" alt="Block-stacking constraint example" longdesc="Diagram of the tree used as an example in the text. A root node P has three children: A, B and E. B has two childrem: C and D." xml:attributes="href source" show="embed" actuate="auto" xmlns:xlink="http://www.w3.org/TR/WD-xlink"/>
<figcap><p>Block-stacking constraint example</p></figcap>
</figure>

<p><emph>Inline-stacking constraints.</emph></p>
<p>This section will recursively define the
inline-stacking constraints between two areas (either two inline-areas or one inline-area
and one line-area),
together with the notion of
<term>fence preceding</term> and <term>fence following</term>; these definitions are interwoven with one another.
This parallels the definition for block-stacking
constraints, but with the additional complication that we may have a stacking
constraint between inline-areas which are stacked in opposite inline-progression-directions.
(This is not an issue for block-stacking constraints because
a block-area which is not a reference-area may not have a
block-progression-direction
different from that of its parent.)</p>
<p>If <var>P</var> and <var>Q</var> have an inline-stacking constraint, then
<var>P</var> has a <term>fence preceding <var>Q</var></term> if <var>P</var> is
a reference-area or has non-zero border-width or padding-width at the first
adjacent edge of <var>P</var> and <var>Q</var>. Similarly, <var>Q</var> has
a <term>fence following <var>P</var></term> if <var>Q</var> is a reference-area
or has non-zero border-width or padding-width at the second
adjacent edge of
<var>P</var> and <var>Q</var>.</p>
<p>If <var>A</var> and <var>B</var> are normal areas, and <var>S</var>
is a sequence of space-specifiers, it is defined that <term><var>A</var> and
<var>B</var> have inline-stacking constraint <var>S</var></term> if any of the
following conditions holds:</p>
<olist>
<item><p><var>A</var> is an inline-area or line-area, <var>B</var> is an inline-area which is the first normal child of
<var>A</var>, and <var>S</var> is the sequence consisting of the space-start of
<var>B</var>.</p></item>
<item><p><var>B</var> is an inline-area or line-area, <var>A</var> is an inline-area which is the last normal child of
<var>B</var>, and <var>S</var> is the sequence consisting of the space-end of
<var>A</var>.</p></item>
<item><p><var>A</var> and <var>B</var> are each either an inline-area or a line-area, and either</p>
    <p>a. both <var>A</var> and <var>B</var> are inline-areas,
    <var>B</var> is the next normal sibling area of <var>A</var>,
    and <var>S</var> is the sequence consisting of the space-end of <var>A</var>
    and the space-start of <var>B</var>;</p>
    <p>b. <var>B</var> is an inline-area which is the first normal child of an inline-area <var>P</var>,
	      <var>P</var> has no fence following <var>A</var>,
<var>A</var> and <var>P</var> have an
		  inline-stacking constraint <var>S</var>', the inline-progression-direction of
		  <var>P</var> is the same as the inline-progression-direction of the nearest
		  common ancestor area of <var>A</var> and <var>P</var>, and <var>S</var> consists of
		  <var>S</var>' followed by the space-start of <var>B</var>.</p>
    <p>c. <var>A</var> is an inline-area which is the last normal child of an inline-area <var>P</var>,
	      <var>P</var> has no fence preceding <var>B</var>,
<var>P</var> and <var>B</var> have an
		  inline-stacking constraint <var>S</var>'', the inline-progression-direction of
		  <var>P</var> is the same as the inline-progression-direction of the nearest
		  common ancestor area of <var>P</var> and <var>B</var>, and <var>S</var> consists of the
		  space-end of <var>A</var> followed by <var>S</var>''.</p>
    <p>d. <var>B</var> is an inline-area which is the last normal child of an inline-area <var>P</var>,
	      <var>P</var> has no fence following <var>A</var>,
<var>A</var> and <var>P</var> have an
		  inline-stacking constraint <var>S</var>', the inline-progression-direction of
		  <var>P</var> is opposite to the inline-progression-direction of the nearest
		  common ancestor area of <var>A</var> and <var>P</var>, and <var>S</var> consists of
		  <var>S</var>' followed by the space-end of <var>B</var>.</p>
    <p>e. <var>A</var> is an inline-area which is the first normal child of an inline-area <var>P</var>,
	      <var>P</var> has no fence preceding <var>B</var>,
<var>P</var> and <var>B</var> have an
		  inline-stacking constraint <var>S</var>'', the inline-progression-direction of
		  <var>P</var> is opposite to the inline-progression-direction of the nearest
		  common ancestor area of <var>P</var> and <var>B</var>, and <var>S</var> consists of the
		  space-start of <var>A</var> followed by <var>S</var>''.</p>
</item>
</olist>
<figure>
<graphic source="inline-stacking1.gif" alt="Adjacent Edges with Inline-stacking" longdesc="Two examples of inline-stacking constraints, illustrating cases 1 and 2 above. The first shows an inline area A containing another area B (A's first child). The left edges of both A and B are outlined. In the second, B contains A, as its last child, and both right edges are outlined." xml:attributes="href source" show="embed" actuate="auto" xmlns:xlink="http://www.w3.org/TR/WD-xlink"/>
<figcap><p>Adjacent Edges with Inline-stacking</p></figcap>
</figure>
<figure>
<graphic source="inline-stacking2.gif" alt="Adjacent Edges with Inline-stacking, continued" longdesc="Three examples of inline-stacking constraints. The first (case 3a) shows two glyph areas A (left) and B (right) next to each other. The right edge of A and the left edge of B are outlined. The second case (3b) shows four adjacent glyph areas (containing an English word and a space A), followed by another inline area containing Devanagari glyphs. The right edge of the space glyph and the left edge of the leftmost Devanagari glyph are outlined. The third case (3c) shows an inline area P containing the word 'bold', to the left of an white space area B. The glyph 'd' is in a glyph area A. The right edge of A and the left edge of B are outlined. " xml:attributes="href source" show="embed" actuate="auto" xmlns:xlink="http://www.w3.org/TR/WD-xlink"/>
<figcap><p>Adjacent Edges with Inline-stacking, continued</p></figcap>
</figure>
<figure>
<graphic source="inline-stacking3.gif" alt="Adjacent Edges with Inline-stacking, continued" longdesc="This diagram illustrates case 3d. Four adjacent glyph areas (three Roman letters and a space A) followed by a inline area P containing Arabic glyph areas, the leftmost of which is labelled B. The right edge of A and the left edge of B are outlined. The diagram also shows a tree view of this structure. The root node has five children: the three Roman letters, the space and the Arabic word. The latter is itself a node containing each Arabic glyph, in document order, i.e. reversed from rendered order." xml:attributes="href source" show="embed" actuate="auto" xmlns:xlink="http://www.w3.org/TR/WD-xlink"/>
<figcap><p>Mixed English and Arabic</p></figcap>
</figure>
<figure>
<graphic source="inline-stacking4.gif" alt="Adjacent Edges with Inline-stacking, continued" longdesc="Case 3e: an inline block P containin Arabic glyph areas is followed by a space glyph B and two other glyphs (Roman). The right edge of the rightmost arabic glyph A and the left edge of B are outlined. A tree view of this structure has a root node with 4 children: the Arabic wordm the space, and the two Roman glyphs. The arabic word is itself a node whose children are glyphs in reverse order than the corresponding areas." xml:attributes="href source" show="embed" actuate="auto" xmlns:xlink="http://www.w3.org/TR/WD-xlink"/>
<figcap><p>Mixed English and Arabic</p></figcap>
</figure>

<p><spot id="fo0001sca_a"/>When <var>A</var> and <var>B</var> have an inline-stacking constraint,
the <term>adjacent edges</term> of <var>A</var> and <var>B</var> are an ordered
pair defined as:</p>
<ulist><item><p>In case 1, the start-edge of the
content-rectangle of <var>A</var>
and the start-edge of the allocation-rectangle of <var>B</var>.</p></item>

<item><p><spot id="jm010062_1-1"/>In case 2, the end-edge of the allocation-rectangle of <var>A</var> and
the end-edge of the content-rectangle of <var>B</var>.</p></item>
<item><p>In case 3a, the end-edge of the
allocation-rectangle of <var>A</var> and
the start-edge of the allocation-rectangle of <var>B</var>.</p></item>
<item><p>In case 3b, the first of the adjacent edges of <var>A</var> and
<var>P</var>, and the start-edge of the allocation-rectangle of <var>B</var>.</p></item>
<item><p>In case 3c, the end-edge of the
allocation-rectangle of <var>A</var>
and the second of the adjacent edges of <var>P</var> and <var>B</var>.</p></item>
<item><p>In case 3d, the first of the adjacent edges of <var>A</var> and
<var>P</var>, and the end-edge of the allocation-rectangle of <var>B</var>.</p></item>
<item><p>In case 3e, the start-edge of the
allocation-rectangle of <var>A</var>
and the second of the adjacent edges of <var>P</var> and <var>B</var>.</p></item></ulist>

<p>Two areas are <term>adjacent</term> if they have a block-stacking constraint
or an inline-stacking constraint. It follows from the definitions that areas of the same
type (inline or block) can be adjacent only if all their non-common ancestors
are also of the same type (up to but not including their nearest common ancestor).
Thus, for example, two inline-areas which reside in different line-areas are never
adjacent.</p>

<p>An area <var>A</var> <term>begins</term> an area <var>P</var> if <var>A</var> is a
descendant of <var>P</var> and <var>P</var> and <var>A</var> have either a
block-stacking constraint or an inline-stacking constraint. In this case the
second of the adjacent edges of <var>P</var> and <var>A</var> is defined to be
a <term>leading edge</term> in <var>P</var>. A space-specifier which applies to
the leading edge is also defined to <term>begin</term> <var>P</var>.</p>

<p>Similarly, An area <var>A</var> <term>ends</term> an area <var>P</var> if <var>A</var> is a
descendant of <var>P</var> and <var>A</var> and <var>P</var> have either a
block-stacking constraint or an inline-stacking constraint. In this case the
first of the adjacent edges of <var>A</var> and <var>P</var> is defined to be
a <term>trailing edge</term> in <var>P</var>. A space-specifier which applies to
the trailing edge is also defined to <term>end</term> <var>P</var>.</p>
</div3>
<div3 id="area-font"><head>Font Baseline Tables</head>
<p>Each script has its preferred "baseline" for aligning glyphs from that script.
Western scripts typically use an "alphabetic" baseline that touches at or near the
bottom of capital letters. Further, for each font there is a
preferred way of aligning embedded glyphs from different scripts, e.g., for a
Western font there are separate baselines for aligning embedded ideographic or Indic
glyphs.</p>
<p>Each block-area and inline-area has a
<trait>dominant-baseline-identifier</trait> trait whose value is a baseline identifier
corresponding to the type of alignment expected for inline-area descendants of that area,
and each inline-area has an <trait>alignment-baseline</trait> which specifies how the
area is aligned to its parent. These traits are interpreted as described in section
<specref ref="font-model"/>.</p>
<p>For each font, an <trait>actual-baseline-table</trait> maps these identifiers
to points on the start-edge of the area. <spot id="area-dominant-baseline-abuse"/>By
abuse of terminology, the line in the inline-progression-direction
through the point corresponding to the dominant-baseline-identifier is called
the "dominant baseline."</p>
</div3>
</div2>
<div2 id="spacecond"><head>Spaces and Conditionality</head>
<p>A space-specifier is a compound datatype whose components are minimum, optimum,
<spot id="aj000035_6a"/>maximum, conditionality, and precedence.</p>
<p><term>Minimum</term>, <term>optimum</term>, and <term>maximum</term> 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. Any of these
values may be negative, which can (for
example) cause areas to overlap, but in any case the minimum should be less
than or equal to the optimum value, and the optimum less than or equal to
the maximum value.</p>
<p><term>Conditionality</term> is an enumerated value which controls whether a
space-specifier has effect at the beginning or end of a reference-area or a
line-area. Possible values are <code role="value">retain</code> and
<code role="value">discard</code>;
a <term>conditional</term> space-specifier is one for which this value is
<code role="value">discard</code>.</p>
<p><term>Precedence</term> has a value which is either an integer or the special
token <code role="value">force</code>. A <term>forcing</term> space-specifier
is one for which this value is <code role="value">force</code>.</p>
<p>Space-specifiers occurring in sequence may interact with each other. The
constraint imposed by a sequence of space-specifiers is computed by
calculating for each space-specifier
its associated <term>resolved space-specifier</term> in accordance with
their conditionality and precedence, as
shown below in the space-resolution rules.</p>
<p>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.</p>
<div3 id="area-space"><head>Space-resolution Rules</head>





<p><spot id="js010069"/>The
resolved space-specifier of a given space-specifier <var>S</var> is
computed as follows. Consider the maximal inline-stacking constraint or
block-stacking constraint <var>S''</var> containing the space-specifier
<var>S</var> as an element of the sequence (<var>S''</var> is a sequence
of space-specifiers; see <specref ref="area-stackcon"/>). Define
<var>S'</var> to be a subsequence of <var>S''</var> as follows:</p>
<ulist>
<item><p>if <var>S</var> is the space-before or space-after of a line-area,
then <var>S'</var> is the maximal subsequence of <var>S''</var> containing
<var>S</var> such that all the space-specifiers in <var>S'</var> are traits
of line-areas,</p></item>
<item><p>if <var>S</var> is the space-before or space-after of a block-area
which is not a line-area,  then <var>S'</var> is the maximal subsequence
of <var>S''</var> containing <var>S</var> such that all the space-specifiers
in <var>S'</var> are traits of block-areas which are not
line-areas,</p></item>
<item><p>if <var>S</var> is the space-start or space-end of an inline-area,
then <var>S'</var> is all of <var>S''</var>.</p></item>
</ulist>
<p>The resolved space-specifier of <var>S</var> is a non-conditional,
<spot id="aj000035_8a"/>forcing space-specifier computed in terms of the
sequence <var>S'</var>.</p>






<olist>
<item><p>If any of the space-specifiers in <var>S'</var> is conditional,
and begins a reference-area or line-area, then it is <term>suppressed</term>,
which means that its resolved space-specifier is zero. Further, any conditional
space-specifiers which consecutively follow it in the sequence are also suppressed.</p>
<p>If a conditional space-specifier ends a reference-area or line-area, then it
is suppressed together with any other conditional space-specifiers which
consecutively precede it in the sequence.</p></item>
<item><p>If any of the remaining space-specifiers in <var>S'</var> is forcing, all non-forcing
space-specifiers are suppressed, and the value of each of the forcing space-specifiers
is taken as its resolved value.</p></item>
<item><p>Alternatively if all of the remaining space-specifiers in <var>S'</var> are non-forcing,
then the resolved space-specifier is defined in terms of those non-suppressed space-specifiers
whose precedence is numerically highest, and among these those whose optimum value is the
greatest. All other space-specifiers are suppressed. If there is only one of
these then its value is taken as its resolved value.</p>
<p><spot id="js010061_9"/>Otherwise, follow these rules when there are
two or more
space-specifiers all of the same highest precedence and the same
(largest) optimum: The resolved space-specifier of the last
space-specifier in the sequence is derived from these spaces by
taking their common optimum value as its optimum. The greatest of
their minimum values is its minimum. The least of their maximum
values is its  maximum. All other space-specifiers are suppressed.</p>
</item>

<item><p>If

<spot id="jc-20010328-b-p-d-1"/>
<var>S</var> is subject to overconstrainment relaxing,
then its maximum value is set to the actual block-progression-dimension of the
containing block-area. See <specref ref="bpd-slack"/></p></item>

</olist>
<p><emph>Example</emph>. Suppose the sequence of space values occurring at the
beginning of a <spot id="aj000035_7a"/>reference-area is:
first, a space with value 10 points (that is
minimum, optimum, and maximum all equal to 10 points) and conditionality
<code role="value">discard</code>; second, a space with value 4 points and
conditionality <code role="value">retain</code>; and third, a space
with value 5 points and conditionality <code role="value">discard</code>;
all three spaces having precedence zero. Then the first (10 point) space is
suppressed under rule 1, and the
second (4 point) space is suppressed under rule 3. The resolved value of the
third space is a non-conditional 5 points, even though
it originally came from a conditional space.</p>
<p>The padding of a block-area does not interact with <spot id="aj000035_7b"/>any
space-specifier
(except that by definition, the presence of padding at the before- or after-edge
prevents areas on either side of it from having a stacking constraint.)</p>
<p>The border or padding at the before-edge or after-edge of a block-area <var>B</var> may
be specified as conditional. If so, then it is set to zero if its associated
edge is a leading edge in a reference-area, and the is-first trait of <var>B</var>
is false, or if its associated
edge is a trailing edge in a reference-area, and the is-last trait of <var>B</var>
is false. In either of these cases, the border
or padding is taken to be zero for purposes of the stacking constraint definitions.</p>
<p>The border or padding at the start-edge or end-edge of an inline-area <var>I</var> may
be specified as conditional. If so, then it is set to zero if its associated
edge is a leading edge in a line-area, and the is-first trait of <var>I</var>
is false, or if its associated
edge is a trailing edge in a line-area, and the is-last trait of <var>I</var>
is false. In either of these cases, the border
or padding is taken to be zero for purposes of the stacking constraint definitions.</p>
</div3>

<div3 id="bpd-slack"><head>Overconstrained space-specifiers</head>
<p>When

<spot id="jc-20010328-b-p-d-2"/>
an area <var>P</var> is generated by a formatting object whose
block-progression-dimension
is "auto", then the constraints involving the before-edge and after-edge of
the content-rectangle of <var>P</var>, together with the constraints between the
various descendants of <var>P</var>, result in a constraint on the actual value
of the block-progression-dimension. If the block-progression-dimension is instead
specified as a length, then this might result in an overconstrained area tree,
for example an incompletely-filled fo:block
with a specified size. In that case some constraints between <var>P</var> and its
descendants should be relaxed; those that are eligible for this treatment are
said to be <emph>subject to overconstrainment relaxing</emph>, and treated as in
the previous section.</p>
<ulist>
<item><p>If the display-align value is "after" or "center" and <var>P</var> is the first normal area generated
by the formatting object, then the space-before of the first normal child of <var>P</var>
is subject to overconstrainment relaxing.</p></item>
<item><p>If the display-align value is "before" or "center" and <var>P</var> is the last normal area generated
by the formatting object, then the space-after of the last normal child of <var>P</var>
is subject to overconstrainment relaxing.</p></item>
</ulist>
</div3>


</div2>
<div2 id="area-block"><head>Block-areas</head>
<p>Block-areas have several traits which typically affect the placement of their
children. The <term>line-height</term> is used in line placement calculations.
The <trait>line-stacking-strategy</trait> trait controls what kind of allocation
is used for descendant line-areas and has an enumerated value
(either <code role="value">font-height</code>, <code role="value">max-height</code>,
or <code role="value">line-height</code>). This is all rigorously described below.
All areas have these traits,
but they only have relevance for areas which have stacked line-area children.</p>
<p>The <trait>space-before</trait> and <trait>space-after</trait> traits
determine the
distance between the block-area and surrounding block-areas.</p>
<p>A block-area which is not a line-area typically has its size in the
inline-progression-direction determined
by its <trait>start-indent</trait> and <trait>end-indent</trait> and by the size of its nearest ancestor
reference-area.


<spot id="jc-20010328-b-p-d-3"/>
A block-area which is not a line-area must be properly stacked (as defined in
<specref ref="area-stackblock"/> below)
unless otherwise specified in the description of its generating formatting object.
In this case it its block-progression-dimension will be subject to constraints based
on the block-progression-dimensions and space-specifiers of its descendants.
See <specref ref="bpd-slack"/></p>

<div3 id="area-stackblock"><head>Stacked Block-areas</head>
<p>Block-area children of an area are typically stacked in the
block-progression-direction
within their parent area, and this is the default method of
positioning block-areas. However, formatting objects
are free to specify other methods of positioning child areas of areas which
they generate, for example list-items or tables.</p>
<p>For a parent area <var>P</var> whose children are
block-areas, <var>P</var> is defined to be <term>properly
stacked</term> if all of the following conditions hold:</p>
<olist>
<item><p>For each block-area <var>B</var> which is a descendant of <var>P</var>,
the following hold:</p>
<ulist><item><p>the before-edge and after-edge
of its allocation-rectangle are parallel to the before-edge and after-edges of the
content-rectangle of <var>P</var>,</p></item>
<item>
<p>the start-edge of its allocation-rectangle is parallel to the start-edge
of the content-rectangle of <var>R</var> (where <var>R</var> is the closest
ancestor reference-area of <var>B</var>), and offset from it inward
by a distance equal to
the block-area's start-indent plus its
<spot id="fo01jr_2a"/><trait>start-intrusion-adjustment</trait>
<spot id="fosg_1a"/>(as defined below), minus its border-start,
padding-start, and space-start values, and</p></item><item>
<p>the end-edge of its allocation-rectangle is parallel to the
end-edge
of the content-rectangle of <var>R</var>, and offset from it inward
by a distance equal to
the block-area's end-indent plus its
<spot id="fo01jr_2b"/><trait>end-intrusion-adjustment</trait>
<spot id="fosg_1b"/>(as defined below),
minus its border-end, padding-end, and space-end
values.</p></item></ulist>
<figure>
<graphic source="RectsForModel.gif" alt="Metrics of a block area" longdesc="This diagram shows a reference area, with all edges labeled: space-start, border-start and padding-start to the left, space-end, border-end and padding-end to the right, space-before, border-before and padding-before at the top, space-after, border-after and padding-after at the bottom. start-indent is shown, spanning space, border and padding on the left, as well as end-indent, spanning space, border and padding on the right." xml:attributes="href source" show="embed" actuate="auto" xmlns:xlink="http://www.w3.org/TR/WD-xlink"/>
<figcap><p>Content Rectangle of Reference Area</p></figcap>
</figure>
<note><p>The notion of indent is intended to apply to the content-rectangle, but
the constraint is written in terms of the
allocation-rectangle, because as noted earlier

(<specref ref="area-geo"/>)
the edges of the
content-rectangle may not
correspond to like-named edges of the
allocation-rectangle.</p>
<p>The <trait>start-intrusion-adjustment</trait> and
<trait>end-intrusion-adjustment</trait> are traits used to
deal with intrusions from
floats in the inline-progression-direction.</p></note>
</item>
<item><p>For each pair of normal areas <var>B</var> and <var>B</var>'
in the subtree below <var>P</var>, if
<var>B</var> and <var>B</var>' have a block-stacking constraint <var>S</var>

<spot id="jc-20010328-empties3"/>

and <var>B</var> is not empty (see <specref ref="area-stackcon"/>),

then the distance between the adjacent edges of <var>B</var> and <var>B</var>'
is consistent with the
constraint imposed by the
resolved values of the space-specifiers in <var>S</var>.</p>
<graphic source="spacebeforeafter.gif" alt="Example of stacked areas" longdesc="Four areas, P, A, B and C. P contains A and B, stacked vertically, and B contains C. Below A is a 3pt space, above B is a 1pt space, and above C (within B) is a 2pt space." xml:attributes="href source" show="embed" actuate="auto" xmlns:xlink="http://www.w3.org/TR/WD-xlink"/>
<p><emph>Example</emph>. In the diagram, if area
<var>A</var>
has a space-after value of 3 points, <var>B</var> a
space-before
of 1 point, and <var>C</var> a space-before of 2 points, all
with
precedence of <code role="value">force</code>, and with zero border and padding,
then the constraints will place <var>B</var>'s
allocation-rectangle
4 points below that of <var>A</var>, and <var>C</var>'s
allocation-rectangle
6 points below that
of <var>A</var>. Thus the 4-point gap receives the
background color
from <var>P</var>, and the 2-point gap before <var>C</var>
receives the background color from <var>B</var>.</p>
</item>
</olist></div3>
<div3 id="intrusadjust"><head>Intrusion Adjustments</head>


<p><spot id="fosg_1c"/>Intrusion adjustments (both start- and end-) are defined to account for the
indentation that occurs as the result of side floats.</p>

<p>If <var>A</var> and <var>B</var> are areas which have the same nearest reference area ancestor, then <var>A</var>
and <var>B</var> are defined to be <term>inline-overlapping</term> if there is some line
parallel to the inline-progression-direction, which intersects both the
allocation-rectangle of <var>A</var> and the allocation-rectangle of <var>B</var>.</p>

<p>If
<spot id="jc-20010327-intrusions"/>

<spot id="jc-20010328-intrusions-1"/>

<spot id="jc-20010501-intrusions"/>

<spot id="jc-20010515-intrusions"/>

<var>A</var> is an area of class <code role="value">xsl-side-float</code> with float="<code role="value">start</code>", and <var>B</var> is a block-area, and <var>A</var> and <var>B</var>
have the same nearest reference area ancestor, then <var>A</var> is defined to <term>encroach</term> upon <var>B</var> if <var>A</var> and <var>B</var>
are inline-overlapping and the start-indent of <var>B</var> is less than the sum of the start-indent of <var>A</var>
and the inline-progression-dimension of <var>A</var>.  The <term>start-encroachment</term> of <var>A</var> on <var>B</var> is then defined to
be amount by which the start-indent of <var>B</var> is less than the sum of the start-indent of <var>A</var> and
the inline-progression-dimension of <var>A</var>.</p>

<p>If <var>A</var> is an area of class <code role="value">xsl-side-float</code> with float="<code role="value">end</code>", and <var>B</var> is a block-area, and <var>A</var> and <var>B</var>
have the same nearest reference area ancestor, then <var>A</var> is defined to <term>encroach</term> upon <var>B</var> if <var>A</var> and <var>B</var>
are inline-overlapping and the end-indent of <var>B</var> is less than the sum of the end-indent of <var>A</var>
and the inline-progression-dimension of <var>A</var>.  The <term>end-encroachment</term> of <var>A</var> on <var>B</var> is then
defined to be amount by which the end-indent of <var>B</var> is less than the sum of the end-indent of <var>A</var> and
the inline-progression-dimension of <var>A</var>.</p>

<p>If <var>B</var> is a block-area which is not a line-area, then its <term>local-start-intrusion-adjustment</term> is computed as the maximum of
the following lengths:</p>

<olist>
<item><p>zero;</p></item>

<item><p>if the parent of <var>B</var> is not a reference area: the start-intrusion-adjustment of the parent of <var>B</var>;
and</p></item>

<item><p>if <var>B</var> has float-displace="<code role="value">block</code>",
then for each area <var>A</var> of class <code role="value">xsl-side-float</code>
with float="<code role="value">start</code>" such that the generating formatting object of <var>A</var> is not a descendant of
the generating formatting object of <var>B</var>, and such that <var>A</var> encroaches upon some line-area child of
<var>B</var>: the start-encroachment of <var>A</var> on <var>B</var>;
and</p></item>

<item><p>if <var>B</var> has float-displace = "<code role="value">block</code>", then for each area <var>A</var> of class <code role="value">xsl-side-float</code> with float="<code role="value">start</code>"
such that <var>A</var> and <var>B</var> are inline-overlapping, and for each block-area ancestor <var>B'</var> of <var>B</var> which is
a descendant of the nearest reference area ancestor of <var>B</var>, such that <var>A</var> encroaches on a line-area
child of <var>B'</var>:  the start-encroachment of <var>A</var> on <var>B'</var>.</p></item>

</olist>

<p>The start-intrusion-adjustment of a block-area <var>B</var> is then defined to be
the maximum of the local-start-intrusion-adjustments of the normal block-areas generated
and returned by the generating formatting object of <var>B</var>.</p>

<p>If <var>L</var> is a line-area, then its start-intrusion-adjustment is computed as the maximum of
the following lengths:</p>

<olist>
<item><p>the start-intrusion-adjustment of the parent of <var>L</var>;</p></item>

<item><p>for each area <var>A</var> of class <code role="value">xsl-side-float</code> with float="<code role="value">start</code>" such that <var>A</var> encroaches upon <var>L</var>:
the start-encroachment of <var>A</var> on <var>L</var>; and</p></item>

<item><p>if the parent of <var>L</var> has float-displace = "<code role="value">indent</code>",
then for each area <var>A</var> of class <code role="value">xsl-side-float</code> with float="<code role="value">start</code>" such that
<var>A</var> and <var>L</var> are inline-overlapping, and for each block-area ancestor <var>B'</var> of <var>L</var> which is
a descendant of the nearest reference area ancestor of <var>L</var>, such that <var>A</var> encroaches on some line-area
child <var>L'</var> of <var>B'</var>:  the start-encroachment of <var>A</var> on <var>B'</var>.</p></item>
</olist>

<p>The end-intrusion-adjustment for a block-area is computed in a precisely analogous manner.
That is:</p>

<p>If <var>B</var> is a block-area which is not a line-area, then its <term>local-end-intrusion-adjustment</term> is computed as the maximum of
the following lengths:</p>

<olist>
<item><p>zero;</p></item>

<item><p>if the parent of <var>B</var> is not a reference area: the end-intrusion-adjustment of the parent of <var>B</var>;
and</p></item>

<item><p>if <var>B</var> has float-displace="<code role="value">block</code>",
then for each area <var>A</var> of class <code role="value">xsl-side-float</code>
with float="<code role="value">end</code>" such that the generating formatting object of <var>A</var> is not a descendant of
the generating formatting object of <var>B</var>, and such that <var>A</var> encroaches upon some line-area child of
<var>B</var>: the end-encroachment of <var>A</var> on <var>B</var>;
and</p></item>

<item><p>if <var>B</var> has float-displace = "<code role="value">block</code>", then for each area <var>A</var> of class <code role="value">xsl-side-float</code> with float="<code role="value">end</code>"
such that <var>A</var> and <var>B</var> are inline-overlapping, and for each block-area ancestor <var>B'</var> of <var>B</var> which is
a descendant of the nearest reference area ancestor of <var>B</var>, such that <var>A</var> encroaches on a line-area
child of <var>B'</var>:  the end-encroachment of <var>A</var> on <var>B'</var>.</p></item>

</olist>

<p>The end-intrusion-adjustment of a block-area <var>B</var> is then defined to be
the maximum of the local-end-intrusion-adjustments of the normal block-areas generated
and returned by the generating formatting object of <var>B</var>.</p>

<p>If <var>L</var> is a line-area, then its end-intrusion-adjustment is computed as the maximum of
the following lengths:</p>

<olist>
<item><p>the end-intrusion-adjustment of the parent of <var>L</var>;</p></item>

<item><p>for each area <var>A</var> of class <code role="value">xsl-side-float</code> with float="<code role="value">end</code>" such that <var>A</var> encroaches upon <var>L</var>:
the end-encroachment of <var>A</var> on <var>L</var>; and</p></item>

<item><p>if the parent of <var>L</var> has float-displace = "<code role="value">indent</code>",
then for each area <var>A</var> of class <code role="value">xsl-side-float</code> with float="<code role="value">end</code>" such that
<var>A</var> and <var>L</var> are inline-overlapping, and for each block-area ancestor <var>B'</var> of <var>L</var> which is
a descendant of the nearest reference area ancestor of <var>L</var>, such that <var>A</var> encroaches on some line-area
child <var>L'</var> of <var>B'</var>:  the end-encroachment of <var>A</var> on <var>B'</var>.</p></item>
</olist>



</div3>
</div2>
<div2 id="area-line"><head>Line-areas</head>
<p>A line-area is a special type of block-area, and is generated by the same
formatting object which generated
its parent. Line-areas do not have borders and padding, i.e., border-before-width,
padding-before-width, etc. are all zero. Inline-areas are stacked within a line-area
relative to a <term>baseline-start-point</term> which is a point determined by the
formatter, on the start-edge of the line area's content-rectangle.</p>
<p>The allocation-rectangle of a line is determined by the value of the
<trait>line-stacking-strategy</trait> trait: if the
value is <code role="value">font-height</code>, the allocation-rectangle is
the <term>nominal-requested-line-rectangle</term>, defined below; if the value is
<code role="value">max-height</code>, the allocation-rectangle is the
<term>maximum-line-rectangle</term>, defined below; and if
the value is
<code role="value">line-height</code>, the allocation-rectangle is the
<term>per-inline-height-rectangle</term>, defined below.
If the <trait>line-stacking-strategy</trait> trait is <code role="value">font-height</code>
or <code role="value">max-height</code> the <trait>space-before</trait> and <trait>space-after</trait>
are both set to the half-leading value; otherwise they are both set to zero.</p>

<p>The <term>nominal-requested-line-rectangle</term> for a line-area is the rectangle
whose start-edge is parallel to the start-edge of the
content-rectangle of the nearest ancestor reference-area and offset from it by the sum
of the start-indent and the start-intrusion-adjustment of the line area,
whose end-edge is parallel to the end-edge of the
content-rectangle of the nearest ancestor reference-area and offset from it by the sum
of the end-indent and the end-intrusion-adjustment of the line area,
whose before-edge is separated from the
baseline-start-point by the text-altitude of the parent block-area, and whose after-edge is
separated from the baseline-start-point by the text-depth of the parent block-area. It has the
same block-progression-dimension for each line-area child of a block-area.</p>

<p>The <term>maximum-line-rectangle</term> for a line-area is the rectangle
whose start-edge and end-edge are parallel to and coincident with the start-edge
and end-edge of the nominal-requested-line-rectangle, and whose
extent in the block-progression-direction is the minimum required to enclose both the
nominal-requested-line-rectangle and the allocation-rectangles of all the
inline-areas stacked within the line-area; this may vary depending on the
descendants of the line-area.</p>

<figure>
<graphic source="InlineExampleMixed.2a.gif" alt="Nominal and Maximum Line Rectangles" longdesc="A horizontal alignment of inline areas (glyphs and graphics). The maximum-line-rectangle wraps all the glyph areas, the nominal-requested-line-rectangle wraps the glyph areas of the first three glyphs (which use the nominal font). The alignment baseline is shown, splitting the n-r-l-r horizontally. The text-altitude is the vertical distance between the baseline and the top of the n-r-l-r, and the text-depth is the distance between the baseline and the bottom of the n-r-l-r." xml:attributes="href source" show="embed" actuate="auto" xmlns:xlink="http://www.w3.org/TR/WD-xlink"/>
<figcap><p><spot id="fo_sg_08"/>Nominal and Maximum Line Rectangles</p></figcap>
</figure>

<p>The <term>per-inline-height-rectangle</term> for a line-area is the rectangle
whose start-edge and end-edge are parallel to and coincident with the start-edge
and end-edge of the nominal-requested-line-rectangle, and whose extent in the
block-progression-dimension is determined as follows.</p>
<p>The <term>expanded-rectangle</term> of an inline-area is the rectangle with start-edge
and end-edge coincident with those of its allocation-rectangle, and whose
before-edge and after-edge are outside those of its allocation-rectangle by a
distance equal to either (a.) the half-leading, when the area's allocation-rectangle is
specified to be the normal-allocation-rectangle by the description of the generating
formatting object , or (b.) the space-before and space-after (respectively),
when the area's allocation-rectangle is specified to be the large-allocation-rectangle. The
<term>expanded-nominal-requested-line-rectangle</term> is the rectangle with start-edge
and end-edge coincident with those of the nominal-requested-line-rectangle, and whose
before-edge and after-edge are outside those of the nominal-requested-line-rectangle by a
distance equal to the half-leading.</p>
<p>The extent of the
per-inline-height-rectangle in the block-progression-direction is then defined to
be the minimum required to enclose both
the expanded-nominal-requested-line-rectangle and the expanded-rectangles of all the
inline-areas stacked within the line-area; this may vary depending on the
descendants of the line-area.</p>
<note><p>
Using the nominal-requested-line-rectangle allows equal baseline-to-baseline
spacing. Using the maximum-line-rectangle allows constant space between line-areas.
Using the
per-inline-height-rectangle and zero space-before and space-after allows
CSS-style line box stacking. Also, the value of half-leading is included in the
expanded-rectangle regardless of conditionality, and thus a line-height conditionality
of "discard" does not have effect in this case.
</p></note>
</div2>
<div2 id="area-inline"><head>Inline-areas</head>
<p>An inline-area has its own <trait>line-height</trait> trait, which may be
different from the line-height of its containing block-area. This may affect the
placement of its ancestor line-area when the line-stacking-strategy
is <code role="value">line-height</code>. An inline-area has an
<trait>actual-baseline-table</trait>
for its <trait>nominal-font</trait>. It has
a <trait>dominant-baseline-identifier</trait> trait which determines how
its stacked inline-area descendants are to be aligned.</p>
<p>An inline-area may or may not have child areas, and if so it may or may not
be a reference-area. The dimensions of the content-rectangle for an inline-area
without children is computed as specified by the generating formatting object,
as are those of an inline-area with block-area children.</p>
<p>An inline-area with inline-area children has a content-rectangle
which extends from its dominant baseline (see

<specref ref="area-font"/>) by its
text-depth in the block-progression-direction, and in the opposite
direction by its text-altitude; in the inline-progression-direction it
extends from the start-edge of the allocation-rectangle of its first child to
the end-edge of the allocation-rectangle of its last child.  The allocation-rectangle
of such an inline-area is the same as its content-rectangle.</p>
<p>The allocation-rectangle of an inline-area without children is either
the normal-allocation-rectangle or the large-allocation-rectangle, as specified
in the description of the generating formatting object.</p>
<note><p>When the line-stacking-strategy is <code role="value">line-height</code>,
allocation is done with respect to the expanded-rectangle.</p></note>
<p>Examples of inline-areas with children might include portions of inline
mathematical expressions or areas arising from mixed writing systems
(left-to-right within right-to-left, for example).</p>
<div3 id="area-stackinline"><head>Stacked Inline-areas</head>
<p>Inline-area children of an area are typically stacked in the
inline-progression-direction
within their parent area, and this is the default method of
positioning inline-areas.</p>
<p>Inline-areas are stacked relative to the <term>dominant baseline</term>,
as defined above

(<specref ref="area-font"/>).</p>
<p>For a parent area <var>P</var> whose children are inline-areas, <var>P</var>
is defined to be <term>properly stacked</term> if all of the following conditions
hold:</p>
<olist>
<item><p>For each inline-area descendant <var>I</var> of <var>P</var>, the
start-edge, end-edge, before-edge and after-edge of the allocation-rectangle
of <var>I</var> are parallel to corresponding edges of the content-rectangle
of the nearest ancestor reference-area of <var>I</var>.</p></item>
<item><p>For each pair of normal areas <var>I</var> and <var>I</var>'
in the subtree below <var>P</var>, if <var>I</var> and <var>I</var>' have
an inline-stacking constraint <var>S</var>, then the distance between the
adjacent edges of <var>I</var> and <var>I</var>' is consistent with the
constraint imposed by the resolved values of the space-specifiers in
<var>S</var>.</p></item>
<item><p>For any inline-area descendant <var>I</var> of <var>P</var>, the
distance in the shift-direction from the dominant baseline of <var>P</var> to the
alignment-point of <var>I</var> equals the offset between the dominant
baseline
of <var>P</var> and the baseline of <var>P</var> corresponding to the
alignment-baseline trait of <var>I</var>, plus the
sum of the
baseline-shifts for <var>I</var> and all of its ancestors which are
descendants of <var>P</var>.</p><p> The first summand is computed to compensate for
mixed writing systems with different baseline types, and the other
summands involve deliberate baseline shifts for things like superscripts
and subscripts.</p></item>
</olist>
</div3>
<div3 id="area-glyph"><head>Glyph-areas</head>
<p>The most common inline-area is a glyph-area, which contains the
representation for a character (or characters) in a particular font.</p>
<p>A glyph-area has an associated <term>nominal-font</term>, determined by
the area's typographic traits, which apply to its character data, and
a <term>glyph-orientation</term> determined by its writing-mode and
reference-orientation, which determine the orientation of the glyph
when it is rendered.</p>
<p>The alignment-point and dominant-baseline-identifier of a glyph-area are assigned
according to the writing-system in use (e.g., the glyph baseline
in Western languages), and are used to control placement of inline-areas
descendants of a line-area. The formatter may generate inline-areas with
different inline-progression-directions from their parent to accommodate
correct inline-area stacking in the case of mixed writing systems.</p>
<p>A glyph-area has no children. Its block-progression-dimension and
actual-baseline-table are the same for all glyphs in a font.
<spot id="fo_sg_04a"/>Conforming implementations may choose to
compute the block-progression-dimension for a glyph area based on the
actual glyph size rather than using a common size for all glyphs
in a font.</p>
</div3>
</div2>

<div2 id="area-order"><head>Ordering Constraints</head>

<div3 id="area-genorder"><head>General Ordering Constraints</head>

<p>A subset <var>S</var> of the areas returned to a formatting object is
called <term>properly ordered</term> if the areas in that
subset have the
same order as their generating formatting objects.  Specifically, if <var>A</var><sub>1</sub>
and <var>A</var><sub>2</sub> are areas in <var>S</var>, returned by child
formatting objects <var>F</var><sub>1</sub> and <var>F</var><sub>2</sub>
where <var>F</var><sub>1</sub> precedes <var>F</var><sub>2</sub>,
then <var>A</var><sub>1</sub> must precede <var>A</var><sub>2</sub> in the
pre-order traversal order of the area tree. If <var>F</var><sub>1</sub>
equals <var>F</var><sub>2</sub> and <var>A</var><sub>1</sub> is
returned prior to <var>A</var><sub>2</sub>, then <var>A</var><sub>1</sub>
must precede <var>A</var><sub>2</sub> in the pre-order-traversal
of the area tree.
</p>
<p>For each formatting object <var>F</var> and each area-class <var>C</var>,
the subset consisting of the areas returned to <var>F</var> with area-class
<var>C</var> must be properly ordered, except where
otherwise specified.
</p>
</div3>
<div3 id="area-linebuild"><head>Line-building</head>
<p>This section describes the ordering constraints that apply to formatting
an fo:block or similar block-level object.</p>
<p>A block-level formatting object <var>F</var> which
constructs lines does so by
constructing block-areas which it returns to its parent
formatting object, and placing normal areas and/or anchor areas returned to
<var>F</var> by its child
formatting objects as children of those block-areas or of
line-areas
which it constructs as children of those block-areas.</p>
<p>For each such formatting object <var>F</var>, it must be
possible to form an
ordered partition <var>P</var> consisting of ordered subsets <var>S</var><sub>1</sub>,
<var>S</var><sub>2</sub>, ..., <var>S</var><sub><var>n</var></sub> of
the normal areas and anchor areas returned by the child formatting objects,
such that the following are all satisfied:</p>
<olist>
<item><p>Each subset consists of a sequence of inline-areas, or of a single
block-area.</p>
</item>
<item><p>The ordering of the partition follows the ordering of the
formatting object tree. Specifically, if <var>A</var> is in
<var>S</var><sub><var>i</var></sub>
and <var>B</var> is in <var>S</var><sub><var>j</var></sub> with
<var>i</var> &lt; <var>j</var>, or if <var>A</var> and <var>B</var> are both in the same subset
<var>S</var><sub><var>i</var></sub> with <var>A</var> before <var>B</var> in the
subset order, then either <var>A</var> is returned by a preceding sibling
formatting object of <var>B</var>, or <var>A</var> and
<var>B</var> are returned by the same
formatting object with <var>A</var> being returned before
<var>B</var>.</p>
</item>
<item><p>The partitioning occurs at legal line-breaks. Specifically, if <var>A</var> is
the last area of <var>S</var><sub><var>i</var></sub> and <var>B</var> is the first area of
<var>S</var><sub><var>i</var>+1</sub>, then the rules of
the language and script in effect must permit a line-break
between <var>A</var> and
<var>B</var>, within the context of all areas in <var>S</var><sub><var>i</var></sub>
and <var>S</var><sub><var>i</var>+1</sub>.</p>
</item>
<item><p>Forced line-breaks are respected. Specifically, if <var>A</var> is the glyph-area
generated by a fo:character whose Unicode character is U+000A, then <var>A</var> must
be the last area in its containing subset <var>S</var><sub><var>i</var></sub>.</p></item>
<item><p>The partition follows the ordering of the area
tree, except for
certain glyph substitutions and deletions.  Specifically, if <var>B</var><sub>1</sub>,
<var>B</var><sub>2</sub>, ..., <var>B</var><sub><var>p</var></sub> are the normal
child areas of the area
or areas returned by <var>F</var>, (ordered in the pre-order traversal order of the
area tree) then there is a one-to-one correspondence between
these child areas
and the partition subsets (i.e., <var>n</var> = <var>p</var>), and for each <var>i</var>,</p>
<ulist>
<item><p>if <var>S</var><sub><var>i</var></sub> consists of a single block-area then
<var>B</var><sub><var>i</var></sub> is that block-area, and</p></item>
<item><p>if <var>S</var><sub><var>i</var></sub> consists of inline-areas then
<var>B</var><sub><var>i</var></sub> is a line-area whose child areas are the
same as the inline-areas in <var>S</var><sub><var>i</var></sub>, and in the same order,
except that where the rules of the language and script in effect call
for glyph-areas to be substituted, inserted, or deleted, then the
substituted or inserted glyph-areas appear in the area tree in the
corresponding place, and the deleted glyph-areas do not appear in the
area tree.
<spot id="fosg_0c"/>Deletions occur when a glyph-area which is last
within a subset <var>S</var><sub><var>i</var></sub>, has a
<trait>suppress-at-line-break</trait> value of <code role="value">suppress</code>,
provided that <var>i</var> &lt; <var>n</var> and <var>B</var><sub><var>i</var>+1</sub> is
a line-area.  Deletions also occur when a glyph-area which is first within a subset
<var>S</var><sub><var>i</var></sub>,
has a <trait>suppress-at-line-break</trait> value of <code role="value">suppress</code>,
provided that <var>i</var> &gt; 1 and <var>B</var><sub><var>i</var>-1</sub> is a line-area.
Insertions and substitutions may
occur because of addition of hyphens or spelling changes due to
hyphenation, or glyph image construction from syllabification, or
ligature formation.</p></item>
</ulist>
</item>
</olist>
<p>Substitutions that replace a sequence of glyph-areas with a single
glyph-area should only occur when the margin, border, and padding in the
inline-progression-direction (start- and end-), baseline-shift, and
letter-spacing values are zero, treat-as-word-space is
<code role="value">false</code>, and the
values of all other relevant traits match (i.e.,
alignment-adjust, alignment-baseline, color
trait, background traits, dominant-baseline-identifier, font traits,
text-depth,
text-altitude, glyph-orientation-horizontal,
glyph-orientation-vertical, line-height, line-height-shift-adjustment,
text-decoration, text-shadow).</p>
<note><p>Line-areas do not receive the background traits or text-decoration
of their generating formatting object, or any other trait that requires
generation of a mark during rendering.</p></note>
</div3>


<div3 id="area-inlinebuild"><head>Inline-building</head>
<p>This section describes the ordering constraints that apply to formatting
an fo:inline or similar inline-level object.</p>
<p>An inline-level formatting object <var>F</var> which
constructs one or more inline-areas does so by
placing normal inline-areas and/or anchor inline-areas returned to <var>F</var> by its child
formatting objects as children of inline-areas which it
generates.</p>
<p>For each such formatting object <var>F</var>, it must be
possible to form an
ordered partition <var>P</var> consisting of ordered subsets <var>S</var><sub>1</sub>,
<var>S</var><sub>2</sub>, ..., <var>S</var><sub><var>n</var></sub> of
the normal and/or anchor inline-areas returned by the child formatting
objects, such that the following are all satisfied:</p>
<olist>
<item><p><spot id="fo0001_16c"/>Each subset consists of a sequence of inline-areas,
or of a single block-area.</p>
</item>
<item><p><spot id="fo0001_16d"/>The ordering of the partition follows
the ordering of the formatting object tree, as defined above.</p>
</item>
<item><p><spot id="fo0001_16e"/>The partitioning occurs at legal line-breaks, as defined above.</p>
</item>
<item><p>Forced line-breaks are respected, as defined above.</p>
</item>
<item><p><spot id="fo0001_16f"/>The partition follows the ordering of the area tree,
except for certain glyph substitutions and deletions, as
defined above.</p>
</item>
</olist>
</div3>
</div2>

<div2 id="keepbreak"><head>Keeps and Breaks</head>
<p>Keep and break conditions apply to a class of areas, which are typically
page-reference-areas,
column-areas, and line-areas.  The appropriate class for a given condition is referred
to as a <term>context</term> and an area in this class is a <term>context-area</term>.
As defined in Section <specref ref="pag-intro"/>, <term>page-reference-areas</term> are
areas generated by an fo:page-sequence using the
specifications in a fo:page-master, and
<spot id="fosg_2a"/><term>column-areas</term> are
normal-flow-reference-areas generated from a region-body, or
region-reference-areas generated from other types of region-master.</p>
<p>A keep or break condition is an open statement about a formatting object and the
tree relationships of the areas it generates with the relevant context-areas. These
tree relationships are defined mainly in terms of <term>leading</term> or <term>trailing</term>
areas.  If <var>A</var> is a descendant of <var>P</var>, then <var>A</var> is defined to
be <term>leading</term> in <var>P</var> if <var>A</var> has no preceding sibling which
is a normal area, nor does any of its ancestor areas up to but not including
<var>P</var>.  Similarly, <var>A</var> is defined to
be <term>trailing</term> in <var>P</var> if <var>A</var> has no following sibling which
is a normal area, nor does any of its ancestor areas up to but not including
<var>P</var>. For any given formatting object, the <term>next</term> formatting object
in the flow is the first formatting object following (in the pre-order traversal order)
which is not a descendant of the given formatting object and
which generates and returns normal areas.</p>
<p>Break conditions are either break-before or break-after conditions.  A break-before
condition is <term>satisfied</term> if the first area generated and returned
by the formatting object is
leading within a context-area. A break-after condition
depends on the next formatting object in
the flow; <spot id="se010003_2"/>the condition
is satisfied if either there is no such next formatting object, or if the
first normal area generated and returned by that formatting object is leading in a context-area.</p>
<p>Break conditions are imposed by the <trait>break-before</trait> and
<trait>break-after</trait> properties. A
refined value of <code role="value">page</code> for these traits imposes a
break condition with a context
consisting of the page-reference-areas; a value of <code role="value">even-page</code>
or <code role="value">odd-page</code> imposes a
break condition with a context of even-numbered page-reference-areas
or odd-numbered
page-reference-areas, respectively; a value of <code role="value">column</code> imposes a
break condition with a
context of column-areas. A value of <code role="value">auto</code> in a
break-before or break-after
trait imposes no break condition.</p>
<p>Keep conditions are either keep-with-previous, keep-with-next, or keep-together
conditions.  A keep-with-previous condition on an object is satisfied if the first
area generated and returned by the formatting object is not leading within a
context-area, or if
there are no preceding areas in a post-order traversal of the area tree.  A
keep-with-next condition is satisfied if the last area generated and returned by the
formatting object is not trailing within a context-area, or
if there are
no following areas in a pre-order traversal of the area tree.  A keep-together
condition is satisfied if all areas generated and returned by the formatting object are
descendants of a single context-area.</p>
<p>Keep conditions are imposed by the "within-page", "within-column", and "within-line" components
of the "keep-with-previous", "keep-with-next", and
<spot id="fo0001jc_a"/>"keep-together" properties.
The refined value of each component specifies the <term>strength</term> of the keep condition
imposed, with higher numbers being stronger than lower numbers and the value
<code role="value">always</code> being stronger than all numeric values.
A component with value <code role="value">auto</code>
does not impose a keep condition.  A "within-page" component imposes a keep-condition
with context consisting of the page-reference-areas; "within-column", with context consisting of
the column-areas; and "within-line" with context consisting of the line-areas.</p>
<p>The area tree is constrained to satisfy all break conditions imposed.
Each keep condition must also be satisfied, except when this would cause a
break condition or a stronger keep condition to fail to be satisfied. If not
all of a set of keep conditions of equal strength can be satisfied, then some
maximal satisfiable subset of conditions of that strength
must be satisfied (together with all break conditions
and maximal subsets of stronger keep conditions, if any).</p>
</div2>

<div2 id="rendmodel"><head>Rendering Model</head>
<p>
This section makes explicit the relationship between the area tree
and visually rendered output.
</p>
<p>
Areas generate three types of marks: (1) the area
background, if any, (2) the marks
intrinsic to the area (a glyph, image, or decoration) if any, and (3) the
area border, if any.
</p>
<p>
An area tree is rendered by causing marks to appear on an output medium in
accordance with the areas in the area tree.  This section describes the
geometric location of such marks, and how conflicts between marks are to
be resolved.
</p>
<div3 id="rend-geo"><head>Geometry</head>
<p>
Each area is rendered in a particular location. Formatting object semantics
describe the location of intrinsic marks relative to the object's location,
i.e., the left, right, top, and bottom edges of its content-rectangle. This
section describes how the area's location is determined,
which determines the location of its intrinsic marks.
</p>
<p>
For each page, the page-viewport-area corresponds isometrically to the
output medium.
</p>
<p>
The page-reference-area is offset from the page-viewport-area as described
below in section <specref ref="rend-view"/>.
</p>
<p>
All areas in the tree with an area-class of <code role="value">xsl-fixed</code>
are positioned such
that the left-, right-, top-, and bottom-edges of its
content-rectangle are
offset inward from the content-rectangle of its ancestor page-viewport-area
by distances specified by the <trait>left-position</trait>,
<trait>right-position</trait>, <trait>top-position</trait>,
and <trait>bottom-position</trait> traits, respectively.
</p>
<p>
Any area in the tree which is the child of a viewport-area is rendered
as described in section <specref ref="rend-view"/>.
</p>
<p>
All other areas in the tree are positioned such that the
left-, right-, top-,
and bottom-edges of its content-rectangle are offset inward
from the
content-rectangle of its nearest ancestor reference-area by distances
specified by the <trait>left-position</trait>,
<trait>right-position</trait>, <trait>top-position</trait>,
and
<trait>bottom-position</trait> traits, respectively.  These are shifted down
and left by the values of the <trait>top-offset</trait>
and <trait>left-offset</trait> traits, respectively, if the area
has a <trait>relative-position</trait> of <code role="value">relative</code>.
</p>
</div3>
<div3 id="rend-view"><head>Viewport Geometry</head>
<p>
A reference-area which is the child of a viewport-area is positioned
such that
the start-edge and end-edge of its content-rectangle are
parallel to the
start-edge and end-edge of the content-rectangle of its parent
viewport-area. The start-edge of its content-rectangle
is offset from the start-edge of the content-rectangle of its parent viewport-area
by an <term>inline-scroll-amount</term>, and the before-edge of its content-rectangle is offset from the
before-edge of
the content-rectangle of its parent viewport-area by a
<term>block-scroll-amount</term>.
</p>
<p>
If the block-progression-dimension of the reference-area is larger
than that
of the viewport-area and the <trait>overflow</trait> trait
for the reference-area is <code role="value">scroll</code>,
then the inline-scroll-amount and block-scroll-amount are
determined by a scrolling mechanism, if any,
provided by the user agent. Otherwise, both are zero.
</p>
</div3>
<div3 id="rend-vis"><head>Visibility</head>
<p>
The visibility of marks depends upon the location of the marks,
the <trait>visibility</trait> of the area, and the <trait>overflow</trait> of any ancestor
viewport-areas.
</p>
<p>
If an area has visibility <code role="value">hidden</code> it generates no marks.
</p>
<p>
If an area has an <trait>overflow</trait> of <code role="value">hidden</code>,
or when the environment is non-dynamic and the <trait>overflow</trait> is
<code role="value">scroll</code> then the area determines
a <term>clipping rectangle</term>, which is defined to be the
rectangle determined by the value of the <trait>clip</trait> trait of the area, and
for any mark
generated by one of its descendant areas, portions of the mark
lying outside
the clipping rectangle do not appear.</p>
</div3>
<div3 id="rend-border"><head>Border, Padding, and Background</head>
<p>
The border- and padding-rectangles are determined relative to the
content-rectangle by the values of the common padding and border width
traits (border-before-width, etc.).
</p>
<p>
For any area, which is not a child of a viewport-area, the border is
rendered between the border-rectangle and the padding-rectangle in
accordance with the common border color and style traits. For a child of
a viewport-area, the border is not rendered.
</p>
<p>For an area, which is not part of a viewport/reference pair, the
background is rendered. For an area that is either a viewport-area or a
reference-area in a viewport/reference pair, if the refined value of
<trait>background-attachment</trait> is <code role="value">scroll</code>
and the block-progression-dimension of the reference-area is larger than
that of the viewport-area, then the background is rendered on the
reference-area and not the viewport-area, and otherwise it is rendered
on the viewport-area and not the reference-area.
</p>
<p>
The background, if any, is rendered in the
padding-rectangle, in accordance
with the <trait>background-image</trait>,
<trait>background-color</trait>,
<trait>background-repeat</trait>,
<trait>background-position-vertical</trait>, and
<trait>background-position-horizontal</trait> traits.
</p>
</div3>
<div3 id="rend-intrinsic"><head>Intrinsic Marks</head>
<p>
For each class of formatting objects, the marks intrinsic to its
generated areas are specified in the formatting object description.
For example, an fo:character object generates a glyph-area, and this
is rendered by drawing a glyph within that area's
content-rectangle in accordance with the area's font traits and <trait>glyph-orientation</trait>
and <trait>blink</trait> traits.
</p>
<p>
In addition, other traits (for example the various score and score-color traits) specify
other intrinsic
marks.  In the case of score traits (<trait>underline-score</trait>,
<trait>overline-score</trait> and <trait>through-score</trait>), the score thickness and position
are specified by the nominal-font in effect; where the font fails to
specify these quantities, they are implementation-dependent.

</p>
</div3>
<div3 id="rend-layer"><head>Layering and Conflict of Marks</head>
<p>
Marks are layered as described below, which defines a partial
ordering of which marks are <term>beneath</term> which other marks.
</p>
<p>
Two marks are defined to <term>conflict</term> if they apply to
the same point
in the output medium. When two marks conflict, the one which is
beneath the other does not affect points in the output medium where
they both apply.
</p>
<p>
Marks generated by the same area are layered as follows: the area
background is beneath the area's intrinsic marks, and the intrinsic
marks are beneath the border.  Layering among the area's intrinsic
marks is defined by the semantics of the area's generating formatting
object and its properties.  For example, a glyph-area's glyph drawing
comes beneath the marks generated for text-decoration.
</p>
<p>The stacking layer of an area is defined by its stacking context and
its z-index value. The stacking layer of an area <var>A</var> is defined to be less
than that of an area <var>B</var> if some ancestor-or-self <var>A'</var> of <var>A</var>
and <var>B'</var> of <var>B</var> have the same stacking context and
the z-index of <var>A'</var> is less
than the z-index of <var>B'</var>. If neither stacking layer is less than the
other then they are defined to have the same stacking layer.</p>

<p>If <var>A</var> and <var>B</var> are areas, and the stacking layer
of <var>A</var> is less than the stacking layer
of <var>B</var>, then all marks generated by <var>A</var>
are beneath all marks generated by <var>B</var>.
</p>
<p>
If <var>A</var> and <var>B</var> are areas with the same
stacking layer, the backgrounds of <var>A</var> and <var>B</var>
come beneath all other marks generated by <var>A</var> and
<var>B</var>. Further, if <var>A</var> is an
ancestor of <var>B</var> (still with the same stacking layer), then
the background of <var>A</var>
is beneath all the areas of <var>B</var>, and all the areas
of <var>B</var> are beneath the intrinsic areas (and border)
of <var>A</var>.
</p>
<p>
If <var>A</var> and <var>B</var> have the same stacking layer and
neither is an ancestor of the other,
then it is an error if either their backgrounds conflict or if a
non-background mark of <var>A</var> conflicts with a
non-background mark of <var>B</var>.
An implementation may recover by proceeding as if the marks from the
first area in the pre-order traversal order are beneath those of the
other area.
</p>
</div3>
</div2>
<div2 id="area-tree-sample"><head>Sample Area Tree</head>
<figure>
<graphic source="page-area-tree.gif" alt="A typical area tree" longdesc="A tree representation of a sample area tree, showing (as nodes) viewports and reference areas from pages, regions, floats, footnote and the main flow." xml:attributes="href source" show="embed" actuate="auto" xmlns:xlink="http://www.w3.org/TR/WD-xlink"/>
<figcap><p>A Typical Area Tree</p></figcap>
</figure>
</div2>
</div1>


<div1 id="refinement"><head>Property Refinement / Resolution</head>


<p>During refinement the set of <term>properties</term> that apply to a formatting
object is transformed into a set of <term>traits</term> that
define constraints on the result of formatting. For many traits there
is a one-to-one correspondence with a property; for other traits the
transformation is more complex. Details on the transformation are
described below.
</p>
<p>The first step in refinement of a particular formatting object
is to obtain the effective value of each property that applies to the
object. Any shorthand property specified on the formatting object is
expanded into the individual properties. This is further described in
<specref ref="shortexpan"/>. For any property that has not been specified
on the object the inherited (see <specref ref="inheritance"/>)
or initial value, as applicable, is used as the effective value.
The second step is to transform this property set into traits.
</p>
<note><p>Although the refinement process is described in a series of
steps, this is solely for the convenience of exposition
and does not imply they must be implemented as separate
steps in any conforming implementation. A conforming implementation
must only achieve the same effect.</p>
</note>
<div2 id="speccomact">
<head>Specified, Computed, and Actual Values, and Inheritance</head>
<p>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."</p>
<div3><head>Specified Values</head>
<p>The specified value of a property is
determined using the following mechanisms
(in order of precedence):</p>
<olist><item><p>
If the tree-construction process placed the property
on the formatting object, use the value of that property
as the specified value.  This is called "explicit
specification".</p></item>
<item><p>
Otherwise, if the property is inheritable, use the value of that
property from the parent formatting object, generally the
computed value (see below).</p></item>
<item><p>
Otherwise use the property's initial value, if it has one.
The initial value of each property is indicated in the
property's definition. If there is no initial value, that
property is not specified on the formatting object.
In general, this is an error.
</p></item></olist>
<p>Since it has no parent, the root of the result tree
cannot use values from its parent formatting
object; in this case, the initial value is used if necessary.</p>
</div3>
<div3><head>Computed Values</head>
<p>Specified values may be absolute (i.e., they are not
specified relative to another value, as in "red" or "2mm")
or relative (i.e., they are specified relative to another value,
as in "auto", "2em", and "12%"), or they may be expressions.
For most absolute values, no
computation is needed to find the computed value. Relative values,
on the other hand, must be transformed into computed values: percentages
must be multiplied by a reference value (each property defines which value
that is), values with a relative unit (em)
must be made absolute by multiplying with the appropriate font size,
"auto" values must be computed by the formulas given with
each property, certain property
values ("smaller", "bolder") must be replaced
according to their definitions.
The computed value of any property that controls a border width
where the style of
the border is "none" is forced to be "0pt".</p>
<p>
Some properties have more than one way in which the property value can be specified.
The simplest example of such properties are those which can be specified
either in terms of a direction relative to the writing-mode (e.g., padding-before)
or a direction in terms of the absolute geometric orientation of the viewport
(e.g., padding-top). These two properties are called the
relative property and the absolute property, respectively.
Collectively, they are called "corresponding properties".</p>
<p>Specifying a value for one property determines both a
computed value for the specified property and a computed value
for the corresponding property.
Which relative property corresponds to which absolute
property depends on the writing-mode. For 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".
The exact specification of how to compute the values of
corresponding properties is given in <specref ref="compcorr"/>.</p>
<p>In most cases, elements inherit computed values. However,
there are some properties whose specified value may be
inherited (e.g., <spot id="c15i9"/>some values for the "line-height"
property).
In the cases where child elements do not inherit the computed value,
this is described in the property definition.</p>
</div3>
<div3><head>Actual Values</head>
<p>A computed value is in principle ready to be
used, but a user agent may not be able to make
use of the value in a given environment. For
example, a user agent may only be able to render
borders with integer pixel widths and may, therefore,
have to adjust the computed width to an integral number
of media pixels. The actual
value is the computed value after any such adjustments have been applied.</p>
</div3>
<div3 id="inheritance"><head>Inheritance</head>
<p>Some of the properties applicable to formatting objects are "inheritable."
Such properties are so identified in the property description.
The inheritable properties can be placed on any formatting
object.  The inheritable properties are propagated down the
formatting object tree from a parent to each child.  (These properties
are given their initial value at the root of the result tree.)
For a given inheritable property, if that property is present on a
child, then that value of the property is used for that child
(and its descendants until explicitly re-set in a lower descendant);
otherwise, the specified value of that property on the child is the
computed value of that property on the parent formatting
object. Hence there is always a specified value
defined for every inheritable property for every
formatting object.</p>
</div3>
</div2>

<div2 id="shortexpan"><head>Shorthand Expansion</head>
<p>In XSL there are two kinds of shorthand properties; those originating
from CSS, such as "border", and those that arise from breaking apart
and/or combining CSS properties, such as "page-break-inside". In XSL
both types of shorthands are handled in the same way.</p>
<note><p>Shorthands are only included in the highest XSL conformance
<spot id="c11i26"/>level: "complete" (<spot id="jm010109_32a"/>see
<specref ref="conform"/>).</p>
<p>The conformance level for each property is shown in
<specref ref="prtab2"/>.</p>
</note>
<p>Shorthand properties do not inherit from
the shorthand on the parent. Instead the individual properties that
the shorthand expands into may inherit.</p>
<p>Some CSS shorthands are interrelated; their expansion has one
or more individual properties in common.
CSS indicates that the user must specify the order of processing
for combinations of multiple interrelated shorthands and individual
interrelated properties. In XML, attributes are defined as unordered.
To resolve this issue, XSL defines a precedence order
when multiple interrelated shorthand properties or a shorthand property
and an interrelated individual property are specified:</p>
<p>They are processed in increasing precision (i.e., "border" is less precise
than "border-top", which is less precise than "border-top-color").
The individual properties are always more precise than any shorthand.
For the remaining ambiguous case, XSL defines the ordering to
be:</p>
<olist>
<item><p>"border-style", "border-color", and "border-width"
is less precise than</p></item>
<item><p>"border-top", "border-bottom", "border-right",
and "border-left".</p></item>
</olist>
<p>Processing is conceptually in the following steps:</p>
<olist>
<item><p>Set the effective value of
all properties to their initial values.</p></item>
<item><p>Process all shorthands in increasing precision.</p>
<p>If the shorthand is set to "inherit": set the effective
value of each property that can be set by the shorthand to
the computed value of the corresponding property in the parent.</p>
<p>If the value of the shorthand is not "inherit": determine which
individual properties are to be set, and replace the
<spot id="c11i27"/>initial value with the computed value derived from the specified
value.</p></item>
<item><p>Process all specified individual properties.</p>
</item>
<item><p>Carry out any inheritance for properties that were
not given a value other than by the first step.</p>
</item>
</olist>
<note><p>For example,
if both the "background"
and the "background-color" properties are specified on a given
formatting object:
process the "background" shorthand, then process the
"background-color" property.</p></note>
</div2>

<div2 id="compcorr"><head>Computing the Values of Corresponding Properties</head>
<p>Where there are corresponding properties, such as "padding-left"
and "padding-start", a computed value is determined for all the
corresponding properties. How the computed values are determined
for a given formatting object is dependent on which of
the corresponding properties are specified on the object. See description
below.</p>
<p>The <spot id="aj000035_10b"/>correspondence mapping from absolute to relative property
is as follows:
</p>
<p>If the "writing-mode" specifies a block-progression-direction of
"top-to-bottom": "top" maps to "before", and "bottom" maps to "after".</p>
<p>If the "writing-mode" specifies a block-progression-direction of
"bottom-to-top": "top" maps to "after", and "bottom" maps to "before".</p>
<p>If the "writing-mode" specifies a block-progression-direction of
"left-to-right": "left" maps to "before", and "right" maps to "after".</p>
<p>If the "writing-mode" specifies a block-progression-direction of
"right-to-left": "left" maps to "after", and "right" maps to "before".</p>
<p>If the "writing-mode" specifies an inline-progression-direction of
"left-to-right": "left" maps to "start", and "right" maps to "end".</p>
<p>If the "writing-mode" specifies an inline-progression-direction of
"right-to-left": "left" maps to "end", and "right" maps to "start".</p>
<p>If the "writing-mode" specifies an inline-progression-direction of
"top-to-bottom": "top" maps to "start", and "bottom" maps to "end".</p>
<p>If the "writing-mode" specifies an inline-progression-direction of
"bottom-to-top": "top" maps to "end", and "bottom" maps to "start".</p>
<p>If the "writing-mode" specifies an inline-progression-direction of
"left-to-right" for odd-numbered lines, and "right-to-left" for
even-numbered <spot id="c11i29"/>lines: "left" maps to "start", and "right" maps to "end".</p>
<note><p>"reference-orientation" is a rotation and does not influence
the <spot id="aj000035_10c"/>correspondence mapping.
</p>
</note>
<div3 id="refine-border-padding"><head>Border and Padding Properties</head>
<p>The simplest class of corresponding properties are
those for which there are only two variants in the
<spot id="aj000035_10d"/>correspondence, an absolute property and a relative
property, and the property names differ only in the
choice of absolute or
relative designation; for example, "border-left-color" and
"border-start-color".</p>
<p>For this class, the computed values of the corresponding
properties are determined as follows. If the corresponding
absolute variant of the property is specified on the formatting
object, its computed value is used to set the computed value of the
corresponding relative property.  If the corresponding absolute property
is not explicitly specified, then the computed
value of the absolute property is set to the computed value of the
corresponding relative property.
<spot id="jm010096_1"/>If the corresponding relative property is specified on the
formatting object and the absolute property only specified by
the expansion of a shorthand, then the computed value of the
absolute property is set to the computed value of the corresponding
relative property.</p>
<p>Note that if both the absolute and the relative
properties are not
explicitly specified, then the rules for determining the specified
value will use either inheritance if that is defined for the property
or the initial value. The initial value must be the same for all possible
corresponding properties. If both an absolute and a corresponding relative
property are explicitly specified, then the above rule gives precedence to the
absolute property, and the specified value of the
corresponding relative property
is ignored in determining the computed value of the corresponding properties.</p>
<p>The (corresponding) properties that use the above rule to
determine their computed value are:</p>
<ulist>
<item><p>border-after-color</p></item>
<item><p>border-before-color</p></item>
<item><p>border-end-color</p></item>
<item><p>border-start-color</p></item>
<item><p>border-after-style</p></item>
<item><p>border-before-style</p></item>
<item><p>border-end-style</p></item>
<item><p>border-start-style</p></item>
<item><p>border-after-width</p></item>
<item><p>border-before-width</p></item>
<item><p>border-end-width </p></item>
<item><p>border-start-width</p></item>
<item><p>padding-after</p></item>
<item><p>padding-before</p></item>
<item><p>padding-end</p></item>
<item><p>padding-start </p></item>
</ulist>
</div3>
<div3><head>Margin, Space, and Indent Properties</head>
<p>The "space-before", and "space-after" properties (block-level
formatting objects), "space-start", and "space-end" properties
(inline-level formatting objects) are handled in the same way as the
properties immediately above, but the corresponding
absolute properties are in the set: "margin-top",
"margin-bottom", "margin-left", and "margin-right".
The .conditionality component of any space-before or space-after determined
from a margin property is set to "retain".</p>
<note><p>The treatment of the .conditionality component is for CSS2
compatibility.</p>
</note>
<note><p>The computed value of a CSS2 margin in the
block-progression-dimension specified as "auto" is 0pt. Any space-before
or space-after determined from a margin value of "auto" is set to 0pt.</p>
</note>

<p><spot id="jm010029_i2"/>There are two more properties, "end-indent"
and "start-indent" (block-level
formatting objects) which correspond to the
various absolute "margin" properties. For these properties,
the correspondence is more complex and involves the corresponding
"border-X-width" and "padding-X" properties,
where X is one of "left", "right", "top" or "bottom".
The computed values of these corresponding properties are determined
as follows:</p>
<p>If the corresponding absolute "margin" property is specified on the
formatting object and the formatting object generates a reference area
the computed value of the margin is used to calculate the computed
value of the corresponding "Y-indent" property,
where Y is either "start" or "end". The formulae for "start-indent"
and "end-indent" are":</p>
<p><code>start-indent = margin-corresponding
+ padding-corresponding + border-corresponding-width</code></p>
<p><code>end-indent = margin-corresponding
+ padding-corresponding + border-corresponding-width</code></p>
<p>If the corresponding absolute "margin" property is specified on the
formatting object and the formatting object does not generate a
reference area, the computed value of the margin and the computed values
of the corresponding "border-X-width" and "padding-X" properties are used to
calculate the computed value of the corresponding "Y-indent" property.
The formulae for "start-indent"
and "end-indent" are:<spot id="jm010029_i1"/></p>
<p><code>start-indent = inherited_value_of(start-indent) +
margin-corresponding + padding-corresponding +
border-corresponding-width</code></p>
<p><code>end-indent = inherited_value_of(end-indent) +
margin-corresponding + padding-corresponding +
border-corresponding-width</code></p>
<p>If the corresponding absolute margin property is not explicitly
specified, <spot id="jm010096_2"/>or if
the corresponding relative property is specified on the
formatting object and the absolute property only specified by
the expansion of a shorthand,
the corresponding absolute margin property is calculated
according to the following formulae:</p>
<p><code>margin-corresponding = start-indent -
inherited_value_of(start-indent) - padding-corresponding -
border-corresponding-width</code></p>
<p><code>margin-corresponding = end-indent -
inherited_value_of(end-indent) - padding-corresponding -
border-corresponding-width</code></p>
<note><p>If the "start-indent" or "end-indent" properties are not
specified their inherited value is used in these formulae.</p>
</note>

</div3>
<div3><head>Height, and Width Properties</head>
<p>Based on the writing-mode in effect for the formatting object,
either the "height", "min-height", and "max-height" properties, or
the "width", "min-width", and "max-width" properties are converted
to the corresponding block-progression-dimension, or
inline-progression-dimension.</p>
<p>The "height" properties are absolute and indicate the dimension
from "top" to "bottom"; the width properties the dimension from
"left" to "right".</p>
<p>If the "writing-mode" specifies a block-progression-direction of
"top-to-bottom" or "bottom-to-top" the conversion is as follows:</p>
<ulist>
<item><p>If any of "height", "min-height", or "max-height" is specified:</p>
<ulist>
<item><p>If "height" is specified then first set:</p>
<p>block-progression-dimension.minimum=&lt;height&gt;</p>
<p>block-progression-dimension.optimum=&lt;height&gt;</p>
<p>block-progression-dimension.maximum=&lt;height&gt;</p>
</item>
<item><p>If "height" is not specified, then first set:</p>
<p>block-progression-dimension.minimum=auto</p>
<p>block-progression-dimension.optimum=auto</p>
<p>block-progression-dimension.maximum=auto</p>
</item>
<item><p>Then, if "min-height" is specified, reset:</p>
<p>block-progression-dimension.minimum=&lt;min-height&gt;</p>
</item>
<item><p>Then, if "max-height" is specified, reset:</p>
<p>block-progression-dimension.maximum<spot id="jm010067_a"/>=&lt;max-height&gt;</p>
</item>
<item><p>However, if "max-height" is specified
as "none", reset:</p>
<p>block-progression-dimension.maximum=auto</p>
</item>
</ulist>
</item>
<item><p>If any of "width", "min-width", or "min-width" is specified:</p>
<ulist>
<item><p>If "width" is specified then first set:</p>
<p>inline-progression-dimension.minimum=&lt;width&gt;</p>
<p>inline-progression-dimension.optimum=&lt;width&gt;</p>
<p>inline-progression-dimension.maximum=&lt;width&gt;</p>
</item>
<item><p>If "width" is not specified, then first set:</p>
<p>inline-progression-dimension.minimum=auto</p>
<p>inline-progression-dimension.optimum=auto</p>
<p>inline-progression-dimension.maximum=auto</p>
</item>
<item><p>Then, if "min-width" is specified, reset:</p>
<p>inline-progression-dimension.minimum=&lt;min-width&gt;</p>
</item>
<item><p>Then, if "max-width" is specified, reset:</p>
<p>inline-progression-dimension.maximum<spot id="jm010067_b"/>=&lt;max-width&gt;</p>
</item>
<item><p>However, if "max-width" is specified
as "none", reset:</p>
<p>inline-progression-dimension.maximum=auto</p>
</item>
</ulist>
</item>
</ulist>
<p>If the "writing-mode" specifies a block-progression-direction of
"left-to-right" or "right-to-left" the conversion is as follows:</p>
<ulist>
<item><p>If any of "height", "min-height", or "max-height" is specified:</p>
<ulist>
<item><p>If "height" is specified then first set:</p>
<p>inline-progression-dimension.minimum=&lt;height&gt;</p>
<p>inline-progression-dimension.optimum=&lt;height&gt;</p>
<p>inline-progression-dimension.maximum=&lt;height&gt;</p>
</item>
<item><p>If "height" is not specified, then first set:</p>
<p>inline-progression-dimension.minimum=auto</p>
<p>inline-progression-dimension.optimum=auto</p>
<p>inline-progression-dimension.maximum=auto</p>
</item>
<item><p>Then, if "min-height" is specified, reset:</p>
<p>inline-progression-dimension.minimum=&lt;min-height&gt;</p>
</item>
<item><p>Then, if "max-height" is specified, reset:</p>
<p>inline-progression-dimension.maximum<spot id="jm010067_c"/>=&lt;max-height&gt;</p>
</item>
<item><p>However, if "max-height" is specified
as "none", reset:</p>
<p>inline-progression-dimension.maximum=auto</p>
</item>
</ulist>
</item>
<item><p>If any of "width", "min-width", or "min-width" is specified:</p>
<ulist>
<item><p>If "width" is specified then first set:</p>
<p>block-progression-dimension.minimum=&lt;width&gt;</p>
<p>block-progression-dimension.optimum=&lt;width&gt;</p>
<p>block-progression-dimension.maximum=&lt;width&gt;</p>
</item>
<item><p>If "width" is not specified, then first set:</p>
<p>block-progression-dimension.minimum=auto</p>
<p>block-progression-dimension.optimum=auto</p>
<p>block-progression-dimension.maximum=auto</p>
</item>
<item><p>Then, if "min-width" is specified, reset:</p>
<p>block-progression-dimension.minimum=&lt;min-width&gt;</p>
</item>
<item><p>Then, if "max-width" is specified, reset:</p>
<p>block-progression-dimension.maximum<spot id="jm010067_d"/>=&lt;max-width&gt;</p>
</item>
<item><p>However, if "max-width" is specified
as "none", reset:</p>
<p>block-progression-dimension.maximum=auto</p>
</item>
</ulist>
</item>
</ulist>
</div3>
<div3 id="overcons_geom"><head>Overconstrained Geometry</head>
<p>The sum of the start-indent, end-indent, and inline-progression-dimension
of the content-rectangle of an area should be equal to the
inline-progression-dimension of the content-rectangle of the closest
ancestor reference-area. In the case where a specification would
lead to them being different the end-indent (and thus the corresponding
margin) is adjusted such that the equality is true.</p>
</div3>
</div2>

<div2><head>Simple Property to Trait Mapping</head>

<p>The majority of the properties map into traits of the same name.
Most of these also simply copy the value from the property.
These are classified as "Rendering", "Formatting", "Specification",
"Font selection", "Reference", and "Action" in the property table in
<specref ref="prtab2"/>.
For example, the property <code>font-style="italic"</code> is
refined into a <trait>font-style</trait> trait with a value of "italic".
</p>
<p>Some traits have a value that is different
from the value of the property. These are classified as "Value change"
in the property table.
For example, the property <code>background-position-horizontal="left"</code>
is refined into a <trait>background-position-horizontal</trait> trait
with a value of "0pt".
The value mapping for these traits is given below.</p>
<div3><head>Background-position-horizontal and background-position-vertical Properties</head>
<p>A value of "top", "bottom", "left", "right", or "center" is
converted to a length as specified in the property definition.</p>
</div3>
<div3><head>Column-number Property</head>
<p>If a value has not been specified on a formatting object to which
this property applies the initial value is computed as specified
in the property definition.</p>
</div3>
<div3><head>Text-align Property</head>
<p>A value of "left", or "right" is converted to the writing-mode
relative value as specified in the property definition.</p>
</div3>
<div3><head>Text-align-last Property</head>
<p>A value of "left", or "right" is converted to the writing-mode
relative value as specified in the property definition.</p>
</div3>
<div3><head>z-index Property</head>
<p>The value is converted to one that is absolute; i.e., the refined value
is the specified value plus the refined value of z-index of its parent
formatting object, if any.</p>
</div3>
</div2>

<div2><head>Complex Property to Trait Mapping</head>
<p>A small number of properties influence traits in a more
complex manner. Details are given below.</p>

<div3><head><spot id="jm010109_7q"/>Word spacing and <spot id="jm010109_7ag"/>Letter spacing Properties</head>
<p>These properties may set values for the <spot id="js010076_1c"/><trait>space-start</trait>
and <trait>space-end</trait> traits, as described in the property
definitions.</p>
</div3>
<div3 id="refine-reference-orientation"><head>Reference-orientation Property</head>
<p>The <trait>reference-orientation</trait> trait is copied from
the reference-orientation property during refinement. During
composition an absolute orientation is determined
(see <specref ref="area-common"/>).</p>

</div3>
<div3 id="refine-writing-mode"><head>Writing-mode and Direction Properties</head>
<p>The <trait>writing-mode</trait>,
<trait>direction</trait>, and
<trait>unicode-bidi</trait> traits
are copied from
the properties of the same name during refinement.
During composition these are used in the determination of
absolute orientations for the
<trait>block-progression-direction</trait>,
<trait>inline-progression-direction</trait>, and
<trait>shift-direction</trait> traits
in accordance with <specref ref="area-common"/>.</p>

</div3>
<div3 id="refine-absolute-pos"><head>Absolute-position Property</head>
<p>If absolute-position = "absolute" or "fixed", the values of the
<trait>left-position</trait>, <trait>top-position</trait>, etc. traits
are copied directly from the
values of the "left", "top", etc. properties. Otherwise these traits'
values are left undefined during refinement and determined during
composition.</p>
</div3>
<div3 id="refine-relative-pos"><head>Relative-position Property</head>
<p>If relative-position = "relative" then the values of the
<trait>left-offset</trait> and
<trait>top-offset</trait> traits are copied directly
from the "left" and "top"
properties. If the "right" property is specified but "left" is not,
then <trait>left-offset</trait> is set to the negative of the
value of "right".  If neither
"left" nor "right" is specified the <trait>left-offset</trait> is 0.
If the "bottom"
property is specified but "top" is not, then
<trait>top-offset</trait> is set to the
negative of the value of "bottom". If neither "top" nor "bottom" is
specified the <trait>top-offset</trait> is 0.</p>
</div3>
<div3 id="refine-text-decoration"><head>Text-decoration Property</head>
<p>The "text-decoration" property value provides values for
the <trait>blink</trait> trait and a set of
score and score-color traits. The <term>specified color</term> has the
value of the <trait>color</trait> trait of the formatting object
for which the "text-decoration" property is being refined.</p>
<p>A property value containing the token "underline" sets a value of
"true" to the <trait>underline-score</trait> trait, and a value of
<term>specified color</term> to the <trait>underline-score-color</trait>
trait.</p>
<p>A property value containing the token "overline" sets a value of
"true" to the <trait>overline-score</trait> trait, and a value of
<term>specified color</term> to the <trait>overline-score-color</trait>
trait.</p>
<p>A property value containing the token "line-through" sets a value of
"true" to the <trait>through-score</trait> trait, and a value of
<term>specified color</term> to the <trait>through-score-color</trait>
trait.</p>
<p>A property value containing the token "blink" sets a value of
"true" to the <trait>blink</trait> trait.</p>
<p>A property value containing the token "no-underline" sets a value of
"false" to the <trait>underline-score</trait> trait, and a value of
<term>specified color</term> to the <trait>underline-score-color</trait>
trait.</p>
<p>A property value containing the token "no-overline" sets a value of
"false" to the <trait>overline-score</trait> trait, and a value of
<term>specified color</term> to the <trait>overline-score-color</trait>
trait.</p>
<p>A property value containing the token "no-line-through" sets a value of
"false" to the <trait>through-score</trait> trait, and a value of
<term>specified color</term> to the <trait>through-score-color</trait>
trait.</p>
<p>A property value containing the token "no-blink" sets a value of
"false" to the <trait>blink</trait> trait.</p>
</div3>

<div3 id="fontprops">
<head>Font Properties</head>
<p>
The font traits on an area are indirectly derived from the combination
of the font properties, which are used to select a font, and the
font tables from that font.
</p>
<p>The abstract model that XSL assumes for a font is described in <specref ref="font-model"/>.
</p>
<p>
There is no XSL mechanism to specify a particular font; instead,
a <term>selected font</term> is chosen from the fonts available to the
User Agent based on a set of selection criteria. The <term>selection
criteria</term> are the following font properties:
"font-family",
"font-style",
"font-variant",
"font-weight",
"font-stretch", and
"font-size",
plus, for some formatting
objects, one or more characters.
The details of
how the selection criteria are used is specified in the
"font-selection-strategy" property (see <specref ref="font-selection-strategy"/>).
</p>
<p>
The <trait>nominal-font</trait> trait is set to the selected font. In the
case where there is no selected font and the 'missing character' glyph
is displayed, the <trait>nominal-font</trait> trait is set to the font containing
that glyph, otherwise
(i.e., some other mechanism was used to indicate that a character
is not being displayed) the <trait>nominal-font</trait> is a
system font.
</p>

<p>
The <trait>dominant-baseline-identifier</trait> and
<trait>actual-baseline-table</trait> traits are derived from the
value of the "dominant-baseline" property. The value of this property
is a compound value with three components: a baseline-identifier for
the dominant-baseline, a baseline-table and a baseline-table
font-size. The <trait>dominant-baseline-identifier</trait> is set from
the first component. The baseline-table font-size is used to scale the
the positions of the baselines from the baseline table and, then, the
position of the dominant-baseline is subtracted from the positions
of the other baselines to yield a table of offsets from the dominant
baseline. This table is the value of the
<trait>actual-baseline-table</trait> trait.
</p>
</div3>
</div2>

<div2><head>Non-property Based Trait Generation</head>
<p>The <trait>is-reference-area</trait> trait is set to "true" for the
following formatting objects:
"simple-page-master", "title",
"region-body", "region-before","region-after", "region-start", "region-end",
"block-container", "inline-container",
"table", "table-caption",
and
"table-cell".
For all other formatting objects it is set to "false".
</p>
</div2>

<div2><head>Property Based Transformations</head>
<div3><head>Text-transform Property</head>
<p>The case changes specified by this property are carried out during
refinement by changing the value of the "character" property
appropriately.</p>
<note><p>The use of the "text-transform" property is deprecated in XSL
due to its severe internationalization issues.</p>
</note>
</div3>
</div2>
<div2><head>Unicode <spot id="jm010109_11c"/>BIDI Processing</head>
<p>The characters in certain scripts are written horizontally from right
to left. In some documents, in particular those written with the
Arabic or Hebrew script, and in some mixed-language contexts, text in
a single (visually displayed) block may appear with mixed
directionality. This phenomenon is called bidirectionality, or <spot id="jm010109_11d"/>"BIDI"
for short.
</p>
<p>The Unicode standard <bibref ref="UNICODE"/> defines a complex
algorithm, the Unicode <spot id="jm010109_11e"/>BIDI algorithm <bibref ref="UNICODE-TR9"/>, for
determining the proper directionality of text. The algorithm is based
on both <spot id="jm010109_33"/>an implicit part based on character properties, as well as
explicit controls for embeddings and overrides.
</p>
<p>The final step of refinement uses this algorithm and the Unicode
bidirectional character type of each character to convert the implicit
directionality of the text into explicit markup in terms of formatting
objects. For example, a sub-sequence of Arabic characters in an
otherwise English paragraph would cause the creation of an inline
formatting <spot id="se010015_1"/>object with the Arabic characters as its content, with a
"direction" property of "rtl" and a "unicode-bidi" property of
"bidi-override". The formatting object makes explict the previously
implicit right to left positioning of the Arabic characters.
</p>
<p>As defined in <spot id="jm010109_34"/><bibref ref="UNICODE-TR9"/>,
the Unicode <spot id="jm010109_11f"/>BIDI algorithm
takes a stream of text as input, and proceeds in three main phases:
</p>
<olist>
<item>
<p>Separation of the input text into paragraphs. The rest of the algorithm
affects only the text between paragraph separators.
</p>
</item>
<item>
<p>Resolution of the embedding levels of the text. In this phase, the
bidirectional character types, plus the Unicode directional formatting
codes, are used to produce <term>resolved embedding levels</term>. The
normative bidirectional character type for each character is specified
in the Unicode Character Database <bibref ref="UNICODE-CD"/>.
</p>
</item>
<item>
<p>Reordering the text for display on a line-by-line basis using the
resolved embedding levels, once the text has been broken into lines.
</p>
</item>
</olist>
<p>The algorithm, as described above, requires some adaptions to fit
into the XSL processing model. First, the final, text reordering step
is not done during refinement.  Instead, the XSL equivalent of
re-ordering is done during formatting. The
<trait>inline-progression-direction</trait> of each glyph is used to
control the stacking of glyphs as described in <specref ref="area-stackcon"/>. The
<trait>inline-progression-direction</trait> is determined at the block
level by the "writing-mode" property and within the inline formatting
objects within a block by the "direction" and "unicode-bidi"
properties that were either specified on inline formatting objects
generated by tree construction or are are on inline formatting objects
introduced by this step of refinement (details below).
</p>
<p>Second, the algorithm is applied to a sequence of characters coming
from the content of one or more formatting objects. The sequence of
characters is created by processing a fragment of the formatting
object tree. A <term>fragment</term> is any contiguous sequence of
children of some formatting object in the tree. The sequence is
created by doing a pre-order traversal of the fragment down to the
fo:character level. During the pre-order traversal, every fo:character
formatting object adds a character to the sequence. Furthermore,
whenever the pre-order scan encounters a node with a "unicode-bidi"
property with a value of "embed" or "override", add a Unicode RLO/LRO
or RLE/LRE character to the sequence as appropriate to the value of
the "direction" and "unicode-bidi" properties. On returning to that
node after traversing its content, add a Unicode PDF character. In
this way, the formatting object tree fragment is flattened into a
sequence of characters. This sequence of characters is called the
<term>flattened sequence of characters</term> below.
</p>
<p>Third, in XSL the algorithm is applied to <term>delimited text
ranges</term> instead of just paragraphs. A delimited text range is a
maximal flattened sequence of characters that does not contain any
delimiters. Any formatting object that generates block-areas is a
delimiter. It acts as a delimiter for its content. It also acts as a
delimiter for its parent's content. That is, if the parent has
character content, then its children formatting objects that generate
block-areas act to break that character content into <term>anonymous
blocks</term> each of which is a delimited text range. In a similar
manner, the fo:multi-case formatting object acts as delimiter for its
content and the content of its parent. Finally, text with an
orientation that is not perpendicular to the dominant-baseline acts as
a delimiter to text with an orientation perpendicular to the
dominant-baseline. We say that <term>text has an orientation
perpendicular to the dominant-baseline</term> if the glyphs that correspond
to the characters in the text are all oriented perpendicular to the
dominant-baseline.
</p>
<note>
<p>In most cases, a delimited text range is the maximal sequence of
characters that would be formatted into a sequence of one or more
line-areas. For the fo:multi-case and the text with an orientation
perpendicular to the dominant-baseline, the delimited range may be a
sub-sequence of a line or sequence of lines. For example, in Japanese
formatted in a vertical writing-mode, rotated Latin and Arabic text
would be delimited by the vertical Japanese characters that
immediately surround the Latin and Arabic text. Any formatting objects
that generated inline-areas would have no affect on the determination
of the delimited text range.
</p>
</note>
<p>For each delimited text range, the <trait>inline-progression-direction</trait>
of the nearest ancestor (including self) formatting object that generates
a block-area determines the <term>paragraph embedding level</term> used
in the Unicode <spot id="jm010109_11g"/>BIDI algorithm. This is the default embedding level
for the delimited text range.
</p>
<p><term>Embedding levels</term> are numbers that indicate how deeply the
text is nested, and the default direction of text on that level. The
minimum embedding level of text is zero, and the maximum embedding
level is level 61. Having more than 61 embedding levels is an
error. An XSL processor may signal the error. If it does not signal
the error, it must recover by allowing a higher maximum number of
embedding levels.
</p>
<p>The second step of the Unicode <spot id="jm010109_11h"/>BIDI algorithm labels each character
in the delimited text range with a <term>resolved embedding level</term>.
The resolved embedding level of each character will be greater than
or equal to the paragraph embedding level. Right-to-left text will
always end up with an odd level, and left-to-right and numeric text
will always end up with an even level. In addition, numeric text
will always end up with a higher level than the paragraph level.
</p>
<p>Once the resolved embedding levels are determined for the
delimited text range, new fo:bidi-override formatting objects with
appropriate values for the "direction" and "unicode-bidi" properties
are inserted into the formatting object tree fragment that was
flattened into the delimited text range such that the following
constraints are satisfied:
</p>
<olist>
<item>
<p>For any character in the delimited text range, the
<trait>inline-progression-direction</trait> of the
character must match its resolved embedding level.
</p>
</item>
<item>
<p>For each resolved embedding level <var>L</var> from the paragraph
embedding level to the maximum resolved embedding level, and for each
maximal contiguous sequence of characters <var>S</var> for which the
resolved embedding level of each character is greater than or equal to
<var>L</var>,
</p>
<olist>
<item>
<p>There is an inline formatting object <var>F</var> which has as its
content the formatting object tree fragment that flattens to
<var>S</var> and has a "direction" property consistent with the
resolved embedding level <var>L</var>.
</p>
<note>
<p><var>F</var> need not be an inserted formatting object if the
constraint is met by an existing formatting object or by specifying
values for the "direction" and "unicode-bidi" properties on an
existing formatting object.
</p>
</note>
</item>
<item>
<p>All formatting objects that contain any part of the sequence
<var>S</var> are properly nested in <var>F</var> and retain the
nesting relationships they had in the formatting object tree prior to
the insertion of the new formatting objects.
</p>
<note>
<p>Satisfying this constraint may require
<spot id="jm010109_35"/>splitting one or more existing
formatting objects in the formatting object tree each into a pair of
formatting objects each of which has the same set of computed property
values as the original, unsplit formatting object. One of the pair
would be ended before the start of <var>F</var> or start after the end
of <var>F</var> and the other would start after the start of
<var>F</var> or would end before the end of <var>F</var>,
respectively. The created pairs must continue to nest properly to
satisfy this constraint. For example, assume Left-to-right text is
represented by the character "L" and Right-to-left text is represented by "R".
In the sub-tree
<eg xml:space="preserve">
 &lt;fo:block&gt;
   LL
   &lt;fo:inline ID="A"&gt;LLLRRR&lt;/fo:inline&gt;
   RR
 &lt;/fo:block&gt;
</eg>
assuming a paragraph embedding level of "0", the resolved embedding
levels would require the following (inserted and replicated) structure:
<eg xml:space="preserve">
 &lt;fo:block&gt;
   LL
   &lt;fo:inline ID="A"&gt;LLL&lt;/fo:inline&gt;
   &lt;fo:bidi-override direction="rtl"&gt;
     &lt;fo:inline ID="A+"&gt;RRR&lt;/fo:inline&gt;
     RR
   &lt;/fo:bidi-override&gt;
 &lt;/fo:block&gt;
</eg>
Note that the fo:inline with ID equal "A" has been split into two
fo:inlines with the first one having the original ID of "A" and the
second having an ID of "A+". Since ID's must be unique, the computed
value of any ID or Key property must not be replicated in the second
member of the pair. The value of "A+" was just used for illustrative
purposes.
</p>
</note>
</item>
</olist>
</item>
<item>
<p>No fewer fo:bidi-override formatting objects can be inserted and still
satisfy the above constraints. That is, add to the refined formatting
object tree only as many fo:bidi-override formatting objects, beyond the
formatting objects created during tree construction, as are needed to
represent the embedding levels present in the document.
</p>
</item>
</olist>
</div2>




<div2><head>Expressions</head>
<p>All property value specifications in attributes within an XSL stylesheet can be expressions. These expressions represent the value of the property specified.    The expression is first evaluated and then the resultant value is used to determine the value of the property.  </p>
<div3><head>Property Context</head>
<p>Properties are evaluated against a property-specific context.  This context provides:</p>
<ulist>
<item>
<p>A list of allowed resultant types for a property value.</p>
</item>
<item>
<p>Conversions from resultant expression value types to an allowed type for the property.</p>
</item>
<item>
<p>The current font-size value.</p>
</item>
<item>
<p>Conversions from relative numerics by type to absolute numerics within additive expressions.</p>
</item>
</ulist>
<note>
<p>It is not necessary that a conversion is provided for all types.  If no conversion is specified, it is an error.</p>
</note>
<p>When a type instance (e.g., a string, a keyword, a
numeric, etc.) is recognized in the expression it is evaluated against
the property context.  This provides the ability for specific values to be
converted with the property context's specific algorithms or conversions
for use in the evaluation of the expression as a whole.  </p>
<p>For example, the "auto" enumeration token for certain
properties is a calculated value.  Such a token would be converted
into a specific type instance via an algorithm specified in the property definition.
In such a case the resulting value might be an absolute length specifying the width
of some aspect of the formatting object.</p>
<p>In addition, this allows certain types like relative numerics to be
resolved into absolute numerics prior to mathematical
operations.</p>
<p>All property contexts allow conversions as specified in
<specref ref="expr.value.conv"/>.</p>
</div3>

<div3><head>Evaluation Order</head>
<p>When a set of properties is being evaluated for a
specific formatting object in the formatting object tree
there is a specific order in which properties must be evaluated.
Essentially, the "font-size" property must be evaluated first before
all other properties.  Once the "font-size" property has been evaluated,
all other properties may be evaluated in any order.</p>
<p>When the "font-size" property is evaluated, the current
font-size for use in evaluation is the font-size of the parent element.
Once the "font-size" property has been evaluated,
that value is used as the
current font-size for all property contexts of all properties value expressions
being further evaluated.</p></div3>
<div3><head>Basics<spot id="c11i31"/></head><scrap headstyle="show"><head/>
<prod id="NT-Expr"><lhs>Expr</lhs><rhs><nt def="NT-AdditiveExpr">AdditiveExpr</nt></rhs></prod>
<prod id="NT-PrimaryExpr">
<lhs>PrimaryExpr</lhs><rhs>'(' <nt def="NT-Expr">Expr</nt> ')'</rhs><rhs>| <nt def="NT-Numeric">Numeric</nt></rhs><rhs>| <nt def="NT-Literal">Literal</nt></rhs><rhs>| <nt def="NT-Color">Color</nt></rhs><rhs>| <nt def="NT-Keyword">Keyword</nt></rhs><rhs>| <nt def="NT-EnumerationToken">EnumerationToken</nt></rhs><rhs>| <nt def="NT-FunctionCall">FunctionCall</nt></rhs>
</prod>
</scrap>
</div3>

<div3><head>Function Calls</head>
<scrap headstyle="show">
<head/>
<prod id="NT-FunctionCall">
<lhs>FunctionCall</lhs>
<rhs><nt def="NT-FunctionName">FunctionName</nt> '(' ( <nt def="NT-Argument">Argument</nt> ( ',' <nt def="NT-Argument">Argument</nt>)*)? ')'</rhs>
</prod>
<prod id="NT-Argument">
<lhs>Argument</lhs>
<rhs><nt def="NT-Expr">Expr</nt></rhs>
</prod>
</scrap>
</div3>

<div3 id="numbers">
<head>Numerics</head>
<p>A numeric represents all the types of numbers in an XSL expression.
Some of these numbers are absolute values.  Others are
relative to some other set of values.  All of these values use a floating-point number to represent the number-part of their definition. </p>
<p>A floating-point number can have any
double-precision 64-bit format IEEE 754 value <bibref ref="IEEE754"/>.
These include a special <quote>Not-a-Number</quote> (NaN) value,
positive and negative infinity, and positive and negative zero.  See
<loc href="http://java.sun.com/docs/books/jls/second_edition/html/typesValues.doc.html#9208" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">Section 4.2.3</loc> of <bibref ref="JLS"/> for a summary of the key
rules of the IEEE 754 standard.</p><scrap headstyle="show"><head/>
<prod id="NT-Numeric"><lhs>Numeric</lhs><rhs><nt def="NT-AbsoluteNumeric">AbsoluteNumeric</nt></rhs><rhs>| <nt def="NT-RelativeNumeric">RelativeNumeric</nt></rhs></prod>
<prod id="NT-AbsoluteNumeric"><lhs>AbsoluteNumeric</lhs><rhs><nt def="NT-AbsoluteLength">AbsoluteLength</nt></rhs></prod><prod id="NT-AbsoluteLength"><lhs>AbsoluteLength</lhs><rhs><nt def="NT-Number">Number</nt> <nt def="NT-AbsoluteUnitName">AbsoluteUnitName</nt>?</rhs></prod>
<prod id="NT-RelativeNumeric"><lhs>RelativeNumeric</lhs><rhs><nt def="NT-Percent">Percent</nt></rhs><rhs>| <nt def="NT-RelativeLength">RelativeLength</nt></rhs></prod>
<prod id="NT-Percent"><lhs>Percent</lhs><rhs><nt def="NT-Number">Number</nt> '%'</rhs></prod>

<prod id="NT-RelativeLength"><lhs>RelativeLength</lhs><rhs><nt def="NT-Number">Number</nt> <nt def="NT-AbsoluteUnitName">RelativeUnitName</nt></rhs></prod></scrap>
<p>The following operators may be used with numerics:</p>
<glist>
<gitem><label><code>+</code></label>
<def>
<p>Performs addition.</p>
</def></gitem>
<gitem><label><code>-</code></label>
<def>
<p>Performs subtraction or negation.</p>
</def></gitem>
<gitem><label><code>*</code></label>
<def>
<p>Performs multiplication.</p>
</def></gitem>
<gitem><label><code>div</code></label>
<def>
<p>Performs floating-point division according to IEEE 754.</p>
</def></gitem>
<gitem><label><code>mod</code></label><def>
<p>Returns the remainder from a truncating division.</p>
</def></gitem>
</glist>
<note>
<p>Since XML allows <code>-</code> in names, the <code>-</code>
operator (when not used as a UnaryExpr negation) typically needs to be
preceded by <spot id="jm010109_7bl"/>white space.   For example the expression <code>10pt - 2pt</code>
means subtract 2 points from 10 points.  The expression <code>10pt-2pt</code>
would mean a length value of 10 with a unit of "pt-2pt".</p>
</note>
<note>
<p>The following are examples of the <code>mod</code> operator:</p>
<ulist>
<item>
<p><code>5 mod 2</code> returns <code>1</code></p>
</item>
<item>
<p><code>5 mod -2</code> returns <code>1</code></p>
</item>
<item>
<p><code>-5 mod 2</code> returns <code>-1</code></p>
</item>
<item>
<p><code>-5 mod -2</code> returns <code>-1</code></p>
</item>
</ulist>
</note>
<note>
<p>The <code>mod</code> operator is the same as the <code>%</code> operator in Java and
ECMAScript and is not the same as the IEEE remainder operation, which
returns the remainder from a rounding division.</p>
</note>
<scrap headstyle="show">
<head>Numeric Expressions</head>
<prodgroup pcw5="1" pcw2="10" pcw4="21">
<prod id="NT-AdditiveExpr">
<lhs>AdditiveExpr</lhs>
<rhs><nt def="NT-MultiplicativeExpr">MultiplicativeExpr</nt></rhs>
<rhs>| <nt def="NT-AdditiveExpr">AdditiveExpr</nt> '+' <nt def="NT-MultiplicativeExpr">MultiplicativeExpr</nt></rhs>
<rhs>| <nt def="NT-AdditiveExpr">AdditiveExpr</nt> '-' <nt def="NT-MultiplicativeExpr">MultiplicativeExpr</nt></rhs>
</prod>
<prod id="NT-MultiplicativeExpr">
<lhs>MultiplicativeExpr</lhs>
<rhs><nt def="NT-UnaryExpr">UnaryExpr</nt></rhs>
<rhs>| <nt def="NT-MultiplicativeExpr">MultiplicativeExpr</nt> <nt def="NT-MultiplyOperator">MultiplyOperator</nt> <nt def="NT-UnaryExpr">UnaryExpr</nt></rhs>
<rhs>| <nt def="NT-MultiplicativeExpr">MultiplicativeExpr</nt> 'div' <nt def="NT-UnaryExpr">UnaryExpr</nt></rhs>
<rhs>| <nt def="NT-MultiplicativeExpr">MultiplicativeExpr</nt> 'mod' <nt def="NT-UnaryExpr">UnaryExpr</nt></rhs>
</prod>
<prod id="NT-UnaryExpr">
<lhs>UnaryExpr</lhs><rhs><nt def="NT-PrimaryExpr">PrimaryExpr</nt></rhs>
<rhs>| '-' <nt def="NT-UnaryExpr">UnaryExpr</nt></rhs>
</prod>
</prodgroup>
</scrap><note><p>The effect of this grammar is that the order of precedence is (lowest precedence first):</p><ulist><item><p>+,  -</p></item><item><p>*, div, mod</p></item></ulist><p>and the operators are all left associative.  For example, 2*3 + 4 div 5 is equivalent to (2*3) + (4 div 5).</p></note>
<p>If a non-numeric value is used in an <nt def="NT-AdditiveExpr">AdditiveExpr</nt> and there is no property context conversion from that type into an absolute numeric value, the expression is invalid and considered an error.</p>
</div3><div3><head>Absolute Numerics</head><p>An absolute numeric is an absolute length which is a pair consisting of a <nt def="NT-Number">Number</nt> and a <nt def="NT-AbsoluteUnitName">UnitName</nt> raised to a power. When an absolute length is written without a unit, the unit power is assumed to be zero.  Hence, all floating point numbers are a length with a power of zero.</p>

<p> Each unit name has associated with it an internal ratio to some common
internal unit of measure (e.g., a meter). When a value is
written in a
property expression, it is first converted to the internal unit of measure
and then mathematical operations are performed.</p>
<p>In
addition, only the mod,
addition, and subtraction operators require that the numerics on
either side of the operation be absolute numerics of the same unit power.
For other operations, the unit powers may be different and the result
should be mathematically consistent as with the handling of powers in algebra.</p>
<p>A property definition may constrain an absolute length to a
particular power.
For example, when specifying font-size, the value is expected to be of
power "one".
That is, it is expected to have a single powered unit specified (e.g., 10pt).</p>
<p>When the final value of <spot id="jm010109_36"/>a property is calculated, the resulting power of the
absolute numeric must be either zero or one.  If any other power is specified,
the value is an error.</p></div3>
<div3><head>Relative Numerics</head><p>Relative lengths are values that are
calculated relative to some other set of values. When written as part of an
expression, they are either converted via the property
context into an absolute numeric or passed verbatim as the property value.</p>
<p>It is an error if the property context has no available conversion
for the relative numeric and a conversion is required for expression
evaluation (e.g., within an add operation).</p>

<div4><head>Percents</head>
<p>Percentages are values that are counted in 1/100 units.  That is, <code>10%</code>
as a percentage value is <code>0.10</code> as a floating point number.
When converting to an absolute numeric, the percentage is defined in the
property definition as being a percentage of some known
property value. <spot id="jm010009_2k"/>If the percentage evaluates to
"auto" the complete expression evaluates to "auto".
</p>
<p> For example, a value of  "110%" on a "font-size"
property
would be evaluated to mean 1.1 times the current font size.
Such a definition of the allowed conversion for percentages is specified on
the property definition.  If no conversion is specified, the resulting value
is a percentage.</p>
</div4>
<div4 id="relative.lengths"><head>Relative Lengths</head>
<p>A relative length is a unit-based value that is measured against the
current value of the <code>font-size</code> property.   </p>
<p>There is only one relative unit of measure, the "em". 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.</p>
<p>When an em measurement is used in an expression, it is converted according
to the font-size value of the current property's context.
The result of the expression is an absolute length.
See <specref ref="font-size"/><spot id="jm010109_37"/>.</p>

</div4>
</div3>
<div3><head>Strings</head>
<p>Strings are represented either as <nt def="NT-Literal">literals</nt> or
as an <nt def="NT-EnumerationToken">enumeration token</nt>.
All properties contexts allow conversion from enumeration tokens to strings.
See <specref ref="expr.value.conv"/>.</p>
</div3>
<div3><head>Colors</head>
<p>A color is a set of values used to identify a particular color from a color space.
Only RGB <spot id="jm010109_38a"/><bibref ref="sRGB"/>
<spot id="c11i32a"/>(Red, Green, Blue)
and ICC <spot id="c11i32b"/>(International Color Consortium)
<spot id="jm010109_38b"/><bibref ref="ICC"/>
colors are included in this Recommendation.</p>
<p>RGB colors are directly represented in the expression language using a
hexadecimal notation.  ICC colors can be specified through an <spot id="fo_sg_03a"/>rgb-icc
function.
Colors can also be specified through the system-color
function or through conversion from an
<nt def="NT-EnumerationToken">EnumerationToken</nt>
via the property context.</p>
</div3>
<div3><head>Keywords</head>
<p>Keywords are special tokens in the grammar that provide access to
calculated values or other property values.
The allowed keywords are defined in the following subsections.</p>
<div4><head>inherit</head>
<p>The property takes the same <emph>computed</emph> value as the property
for the formatting object's parent object.</p>
<note><p>"inherit" is not allowed as an expression mixed with operations.
The same functionality is provided by the from-parent() function, which
can be mixed with operations.</p>
</note>
</div4>
</div3>
<div3><head>Lexical Structure</head>
<p>When processing an expression,
<spot id="jm010109_7bm"/>white space (<nt def="NT-ExprWhitespace">ExprWhitespace</nt>) may be
allowed before or after any expression token even though it is not
explicitly defined as such in the grammar.  In some cases, <spot id="jm010109_7bn"/>white space
is necessary to make tokens in the grammar lexically distinct.
Essentially, <spot id="jm010109_7bo"/>white space should be treated as if it does not exist
after tokenization of the expression has occurred.</p>
<p>The following special tokenization rules must be applied in the
order specified to disambiguate the grammar:</p>
<ulist>
<item>
<p>If the character following an
<xnt href="http://www.w3.org/TR/REC-xml-names/#NT-NCName" show="new" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">NCName</xnt> (possibly after intervening
<nt def="NT-ExprWhitespace">ExprWhitespace</nt>) is
"<code>(</code>",
then the token must be recognized as
<nt def="NT-FunctionName">FunctionName</nt>.</p></item>
<item>
<p>A number terminates at the first occurrence of a non-digit character other
than "<code>.</code>".  This allows the unit token for
length quantities to parse properly.</p></item>
<item>
<p>When an <xnt href="http://www.w3.org/TR/REC-xml-names/#NT-NCName" show="new" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">NCName</xnt> immediately follows a
<nt def="NT-Number">Number</nt>, it should be recognized as a
<nt def="NT-AbsoluteUnitName">UnitName</nt> or it is an error.</p></item>
<item>
<p>The <nt def="NT-Keyword">Keyword</nt> values take precedence over
<nt def="NT-EnumerationToken">EnumerationToken</nt>.</p></item>
<item>
<p>If a <xnt href="http://www.w3.org/TR/REC-xml-names/#NT-NCName" show="new" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">NCName</xnt> follows a
<spot id="aj000035_12"/><xnt href="#NT-Numeric" show="new" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">numeric</xnt>,
it should be recognized as an <nt def="NT-OperatorName">OperatorName</nt> or it is an error.</p></item></ulist>
<scrap headstyle="show">
<head>Expression Lexical Structure</head>
<prodgroup pcw5="1" pcw2="8" pcw4="21">
<prod id="NT-ExprToken">
<lhs>ExprToken</lhs>
<rhs>'(' | ')' | '%'</rhs>
<rhs>| <nt def="NT-Operator">Operator</nt></rhs>
<rhs>| <nt def="NT-FunctionName">FunctionName</nt></rhs><rhs>| <nt def="NT-EnumerationToken">EnumerationToken</nt></rhs>
<rhs>| <nt def="NT-Number">Number</nt></rhs>
</prod>
<prod id="NT-Number">
<lhs>Number</lhs>
<rhs>  <nt def="NT-FloatingPointNumber">FloatingPointNumber</nt></rhs>
</prod>
<prod id="NT-FloatingPointNumber"><lhs>FloatingPointNumber</lhs><rhs><nt def="NT-Digits">Digits</nt> ('.' <nt def="NT-Digits">Digits</nt>?)?</rhs><rhs>| '.' <nt def="NT-Digits">Digits</nt></rhs></prod>
<prod id="NT-Digits">
<lhs>Digits</lhs>
<rhs>[0-9]+</rhs>
</prod>
<prod id="NT-Color"><lhs>Color</lhs><rhs>'#' <nt def="NT-AlphaOrDigits">AlphaOrDigits</nt></rhs></prod>
<prod id="NT-AlphaOrDigits">
<lhs>AlphaOrDigits</lhs>
<rhs>[a-fA-F0-9]+</rhs>
</prod>
<prod id="NT-Literal">
<lhs>Literal</lhs>
<rhs>'"' [^"]* '"'</rhs>
<rhs>| "'" [^']* "'"</rhs>
</prod>
<prod id="NT-Operator">
<lhs>Operator</lhs>
<rhs><nt def="NT-OperatorName">OperatorName</nt></rhs>
<rhs>| <nt def="NT-MultiplyOperator">MultiplyOperator</nt></rhs>
<rhs>| '+' | '-'</rhs>
</prod>
<prod id="NT-OperatorName">
<lhs>OperatorName</lhs>
<rhs>'mod' | 'div'</rhs>
</prod>
<prod id="NT-MultiplyOperator">
<lhs>MultiplyOperator</lhs>
<rhs>'*'</rhs>
</prod>
<prod id="NT-Keyword"><lhs>Keyword</lhs><rhs>'inherit'</rhs></prod>
<prod id="NT-FunctionName">
<lhs>FunctionName</lhs>
<rhs>
<xnt href="http://www.w3.org/TR/REC-xml-names/#NT-NCName" show="new" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">NCName</xnt></rhs>
</prod>
<prod id="NT-EnumerationToken"><lhs>EnumerationToken</lhs><rhs><xnt href="http://www.w3.org/TR/REC-xml-names/#NT-NCName" show="new" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">NCName</xnt></rhs></prod>
<prod id="NT-AbsoluteUnitName"><lhs>AbsoluteUnitName</lhs><rhs>'cm' | 'mm' | 'in' | 'pt' | 'pc' | 'px'</rhs></prod>
<prod id="NT-RelativeUnitName"><lhs>RelativeUnitName</lhs><rhs>'em'</rhs></prod>
<prod id="NT-ExprWhitespace">
<lhs>ExprWhitespace</lhs>
<rhs><xnt href="http://www.w3.org/TR/REC-xml#NT-S" show="new" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">S</xnt></rhs>
</prod>
</prodgroup>
</scrap>
</div3>
<div3 id="expr.value.conv"><head>Expression Value Conversions</head>
<p>Values that are the result of an expression evaluation may be converted
into property value types.  In some instances this is a simple verification
of set membership (e.g., is the value a legal country code).  In other cases,
the value is expected to be a simple type like an integer and must be converted.</p>
<p>It is not necessary that all types be allowed to be converted.  If the
expression value cannot be converted to the necessary type for the property value,
it is an error.</p>
<p>The following table indicates what conversions are allowed.</p>
<table border="1">
<tbody align="left" valign="top">
<tr align="left" valign="top"><th rowspan="1" colspan="1" align="left" valign="top">Type</th><th rowspan="1" colspan="1" align="left" valign="top">Allowed Conversions</th><th rowspan="1" colspan="1" align="left" valign="top">Constraints</th></tr>
<tr align="left" valign="top">
<td rowspan="1" colspan="1" align="left" valign="top"><xnt href="http://www.w3.org/TR/REC-xml-names/#NT-NCName" show="new" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">NCName</xnt></td>
<td rowspan="1" colspan="1" align="left" valign="top">
<ulist>
<item>
<p>Color, via the system-color() function.</p></item>
<item>
<p>Enumeration value, as defined in the property definition.</p></item>
<item>
<p>To a string literal</p></item></ulist></td><td rowspan="1" colspan="1" align="left" valign="top">The value may be checked against
a legal set of values depending on the property.</td></tr><tr align="left" valign="top"><td rowspan="1" colspan="1" align="left" valign="top">
<nt def="NT-AbsoluteNumeric">AbsoluteNumeric</nt></td><td rowspan="1" colspan="1" align="left" valign="top">
<ulist>
<item>
<p>Integer, via the round() function.</p></item>
<item>
<p>Color, as an RGB color value.</p></item></ulist>
</td>
<td rowspan="1" colspan="1" align="left" valign="top">
If converting to an RGB color value, it must be a legal color value from the color
space.</td></tr><tr align="left" valign="top"><td rowspan="1" colspan="1" align="left" valign="top"><nt def="NT-RelativeLength">RelativeLength</nt></td><td rowspan="1" colspan="1" align="left" valign="top">
<ulist>
<item>
<p>To an AbsoluteLength</p></item></ulist>
</td>
<td rowspan="1" colspan="1" align="left" valign="top">
</td>
</tr>
</tbody>
</table>
<p>The specific conversion to be applied is property specific and can be
found in the definition of each property.</p>
<note><p>Conversions of compound property values are not allowed; thus
for example,
space-before.optimum="inherited-property-value(space-before)" is invalid.
Permitted are, for example,
space-before="inherited-property-value(space-before)" and
space-before.optimum="inherited-property-value(space-before.optimum)"
since they do not require conversion.</p>
</note>
</div3>
<div3><head>Definitions of Units of Measure</head>
<p>The units of measure in this Recommendation have the following definitions:</p>
<table border="1">
<tbody align="left" valign="top">
<tr align="left" valign="top"><th rowspan="1" colspan="1" align="left" valign="top">Name</th><th rowspan="1" colspan="1" align="left" valign="top">Definition</th></tr>
<tr align="left" valign="top"><td rowspan="1" colspan="1" align="left" valign="top">cm</td><td rowspan="1" colspan="1" align="left" valign="top">See <spot id="c11i1_c"/><bibref ref="ISO31"/></td></tr>
<tr align="left" valign="top"><td rowspan="1" colspan="1" align="left" valign="top">mm</td><td rowspan="1" colspan="1" align="left" valign="top">See <spot id="c11i1_d"/><bibref ref="ISO31"/></td></tr>
<tr align="left" valign="top"><td rowspan="1" colspan="1" align="left" valign="top">in</td><td rowspan="1" colspan="1" align="left" valign="top">2.54cm</td></tr>
<tr align="left" valign="top"><td rowspan="1" colspan="1" align="left" valign="top">pt</td><td rowspan="1" colspan="1" align="left" valign="top">1/72in</td></tr>
<tr align="left" valign="top"><td rowspan="1" colspan="1" align="left" valign="top">pc</td><td rowspan="1" colspan="1" align="left" valign="top">12pt</td></tr>
<tr align="left" valign="top"><td rowspan="1" colspan="1" align="left" valign="top">px</td><td rowspan="1" colspan="1" align="left" valign="top">See <specref ref="pixels"/></td></tr>
<tr align="left" valign="top"><td rowspan="1" colspan="1" align="left" valign="top">em</td><td rowspan="1" colspan="1" align="left" valign="top">See <specref ref="relative.lengths"/></td></tr>
</tbody>
</table>
<div4 id="pixels"><head>Pixels</head>
<p> 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.  This interpretation is follows:
</p>
<olist>

<item><p>The preferred definition of one 'px' is:</p>
<ulist>
<item><p>The actual distance covered by the largest integer number of
device dots (the size of a device dot is measured as the distance
between dot centers) that spans a distance less-than-or-equal-to
the distance specified by the arc-span rule in
<spot id="c11i33"/><xspecref href="http://www.w3.org/TR/REC-CSS2/syndata.html#x39" show="new" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">http://www.w3.org/TR/REC-CSS2//syndata.html#x39</xspecref>.
In XSL this is assumed to be 0.28mm [approximately 1/90"]
for print, desktop computer monitors,
and hand-held devices viewed at normal viewing distances.</p>
</item>
<item><p>A minimum of the size of 1 device dot should be used.</p></item>
<item><p>This calculation is done separately in each axis,
and may have a different value in each axis.</p></item>
</ulist>
</item>

<item><p>However, implementors may instead simply pick a fixed conversion
factor, treating 'px' as an absolute unit of measurement (such as
1/92" or 1/72").</p></item>
</olist>

<note>

<p>Pixels should not be mixed with other absolute units in
expressions as they may cause undesirable effects.
Also, particular caution should be used with inherited property values
that may have been specified using pixels.</p>

<p>If the User Agent chooses a measurement for a 'px' that
does not match an integer number of device dots in each axis it may
produce undesirable effects, such as:</p>
<ulist>
<item><p>moir<entity name="eacute"/> patterns in scaled raster graphics</p></item>
<item><p>unrenderable overlapping areas when the renderer rounds fonts
or graphics sizes upward to its actual dot-size</p></item>
<item><p>large spaces between areas when the renderer rounds fonts or
graphics sizes downward to its actual dot-size</p></item>
<item><p>unreadable results including unacceptably small text/layout
(for example, a layout was done at 72 dpi [dots per inch], but
the renderer assumed the result was already specified in device
dots and renders it at 600 dpi).</p></item>
</ulist>

<p>Stylesheet authors should understand a pixel's actual size may
vary from device to device:</p>
<ulist>
<item><p>stylesheets utilizing 'px' units may not produce consistent
results across different implementations or different
output devices from a single implementation</p></item>
<item><p>even if stylesheets are expressed entirely in 'px' units
the results may vary on different devices</p></item>
</ulist>

</note>

</div4>
</div3>
</div2>
<div2><head>Core Function Library</head>
<div3><head>Number Functions</head>

<proto name="floor" return-type="numeric">
<arg type="numeric"/></proto>
<p>The <function>floor</function> function returns the largest (closest to
positive infinity) integer that is not greater than the argument.
The numeric argument to this function must be of unit power zero.</p>
<note><p>If it is necessary to use the <function>floor</function> function for a
property where a unit power of one is expected, then an expression
such as: <spot id="jf000082_3"/>"floor(1.4in div 1.0in)*1.0in" must be used.
This applies to the ceiling,
round, and other such functions where a unit power of zero is required.</p></note>
<proto name="ceiling" return-type="numeric"><arg type="numeric"/></proto>
<p>The <function>ceiling</function> function returns the smallest (closest
to negative infinity) integer that is not less than the argument.  The numeric
argument to this function must be of unit power zero.</p>
<proto name="round" return-type="numeric"><arg type="numeric"/></proto>
<p>The <function>round</function> function returns the integer that is
closest to the argument.  If there are two such
numbers, then the one that is closest to positive infinity is
returned.  The numeric argument to this function must be of unit power zero.</p>

<proto name="min" return-type="numeric">
<arg type="numeric"/><arg type="numeric"/></proto>
<p>The <function>min</function> function returns the minimum of the
two numeric arguments.  These arguments must have the same unit power.</p>

<proto name="max" return-type="numeric"><arg type="numeric"/>
<arg type="numeric"/></proto>
<p>The <function>max</function> function returns the maximum of the two
numeric arguments.  These arguments must have the same unit power.</p>

<proto name="abs" return-type="numeric">
<arg type="numeric"/></proto><p>The <function>abs</function> function
returns the absolute value of the numeric argument.
That is, if the numeric argument is negative, it returns the negation of
the argument.</p></div3>
<div3 id="expr-color-functions"><head>Color Functions</head>
<proto name="rgb" return-type="color"><arg type="numeric"/><arg type="numeric"/>
<arg type="numeric"/></proto>
<p>The <function>rgb</function> function returns a specific color from the RGB
color space.  The parameters to this function must be numerics (real numbers) with a
length power of zero.</p>
<proto name="rgb-icc" return-type="color"><arg type="numeric"/><arg type="numeric"/>
<arg type="numeric"/><arg type="NCName"/><arg type="numeric"/><arg type="numeric" occur="rep"/></proto>
<p>The <spot id="fo_sg_03b"/><function>rgb-icc</function> function
returns a specific color from <spot id="c11i35"/>the ICC Color Profile.  The color profile is specified by the name parameter (the fourth parameter).  This color profile must have been declared in the fo:declarations formatting object using an fo:color-profile formatting object.</p>
<p>The first three parameters specify a fallback color from the sRGB color space.  This color is used when the color profile is not available.</p>
<p>The color is specified by a sequence of one or more color values (real numbers) specified after the name parameter.  These values are specific to the color profile.</p>
<proto name="system-color" return-type="color">
<arg type="NCName"/></proto>
<p>The <function>system-color</function> function returns a system defined
color with a given name.</p>
</div3><div3><head>Font Functions</head>
<proto name="system-font" return-type="object">
<arg type="NCName"/><arg type="NCName" occur="opt"/></proto>
<p>The <function>system-font</function> function returns a
characteristic of a system font.  The first argument is the
name of the system font and the second argument, which is optional,
names the property that specifies the characteristic.  If the second
argument is omitted, then the characteristic returned is the same as
the name of the property to which the expression is being assigned.</p>
<p>For example, the expression
"system-font(heading,font-size)" returns the font-size
characteristic for the system font named "heading".  This is equivalent to the
property assignment
'font-size="system-font(heading)"'.</p></div3>
<div3><head>Property Value Functions</head>

<proto name="inherited-property-value" return-type="object"><arg type="NCName" occur="opt"/></proto>
<p>The <function>inherited-property-value</function> function returns the
inherited value of the property whose name matches the argument specified,
<spot id="fo_sg_05d"/>or if omitted for the property for which
the expression is being evaluated.
It is an error if this property is not an inherited property.</p>
<p><spot id="aj000035_13"/>The returned "inherited value" is
the computed value
of this property on this object's parent. In particular,
given the following example:</p>
<eg xml:space="preserve">
&lt;fo:list-block&gt;
  ...
  &lt;fo:list-item color="red"&gt;
    &lt;fo:list-item-body background-color="green"&gt;
      &lt;fo:block background-color="inherited-property-value(color)"&gt;
      &lt;/fo:block&gt;
    &lt;/fo:list-item-body&gt;
  &lt;/fo:list-item&gt;
&lt;/fo:list-block&gt;
</eg>
<p>The background-color property on the fo:block is assigned
the value "red" because the (computed, after inheritance)
value of the color (not background-color) property on the
fo:list-item-body that is the parent of fo:block is "red".</p>


<proto name="label-end" return-type="numeric"/>
<p>The <function>label-end</function> function returns the calculated
label-end value for lists.  See the definition in
<spot id="c11i1_e"/><specref ref="provisional-label-separation"/>.</p>
<proto name="body-start" return-type="numeric"/>
<p>The <function>body-start</function> function returns the
calculated body-start value for lists.
See the definition in
<spot id="c11i1_f"/><specref ref="provisional-distance-between-starts"/>.</p>
<note><p>When this function is used outside of a list, it still
returns a calculated value as specified.</p></note>

<proto name="from-parent" return-type="object">
<arg type="NCName" occur="opt"/></proto>
<p>The <function>from-parent</function> function
returns a computed value of the property whose name matches
the argument specified,
<spot id="fo_sg_05e"/>or if omitted for the property for which
the expression is being evaluated.
The value returned is that for the parent of the
formatting object for which the expression is evaluated.
If there is no parent, the value returned is the initial
value. If the argument specifies a shorthand property and if
the expression only consists of the from-parent function with an
argument matching the property being computed, it is
interpreted
as an expansion of the shorthand with each property into which
the shorthand expands, <spot id="c11i36_a"/>each having a value of from-parent with
an argument matching the property.
It is an error if arguments matching a shorthand property are used
in any other way.
</p>

<proto name="from-nearest-specified-value" return-type="object">
<arg type="NCName" occur="opt"/></proto>
<p>The <function>from-nearest-specified-value</function> function
returns a computed value of the property whose name matches
the argument specified,
<spot id="fo_sg_05a"/>or if omitted for the property for which
the expression is being evaluated.
The value returned is that for the closest ancestor of the
formatting object for which the expression is evaluated on
which there
is an assignment of the property in the XML result tree in the
fo namespace.
If there is no such ancestor, the value returned is the
initial value.
If the argument specifies a shorthand property and if
the expression only consists of the from-nearest-specified-value function with an
argument matching the property being computed, it is
interpreted
as an expansion of the shorthand with each property into which
the shorthand expands, <spot id="c11i36_b"/>each having a value of from-nearest-specified-value with
an argument matching the property.
It is an error if arguments matching a shorthand property are used
in any other way.
</p>

<proto name="from-table-column" return-type="object">
<arg type="NCName" occur="opt"/></proto>
<p>The <function>from-table-column</function> function
returns the inherited value of the property whose name matches the
argument specified,
<spot id="fo_sg_05b"/>or if omitted for the property for which
the expression is being evaluated,
from the fo:table-column whose column-number
matches the column for which this expression is evaluated and
whose number-columns-spanned also matches any span.
If there is no match for the number-columns-spanned, it is
matched
against a span of 1. If there is still no match, the initial
value is returned.
It is an error to use this function on formatting objects
that are not an fo:table-cell or its descendants.
</p>

<proto name="proportional-column-width" return-type="numeric">
<arg type="numeric"/></proto>
<p>The <function>proportional-column-width</function> function
returns <spot id="aj000035_14"/><var>N</var> units of proportional measure
where <var>N</var> is the argument given to this function.
The column widths are first determined ignoring the proportional
measures. The difference between the table-width and the sum of
the column widths is the available proportional width. One unit
of proportional measure is the available proportional width
divided by the sum of the proportional factors.
It is an error to use this function on formatting objects other
than an fo:table-column. It is also an error to use this function
if the fixed table layout is not used.
</p>

<proto name="merge-property-values" return-type="object">
<arg type="NCName" occur="opt"/></proto>
<p>The <function>merge-property-values</function> function returns a value of the
property whose name matches the argument,
<spot id="fo_sg_05c"/>or if omitted for the property for which
the expression is being evaluated.
The value returned is the specified value on the last
fo:multi-property-set, of the parent fo:multi-properties,
that applies to the User Agent state.
If there is no such value, the computed value of the
parent fo:multi-properties is returned.
</p>
<note><p>The test for applicability of a User Agent state is
specified using the "active-state" property.</p></note>
<p>It is an error to use this function on formatting objects other
than an fo:wrapper that is the child of an fo:multi-properties.</p>
</div3>
</div2>


<div2><head>Property Datatypes</head>
<p>Certain property values are described in terms of compound
datatypes, in terms of restrictions on permitted number values, or
strings with particular semantics.</p>
<p>The compound datatypes, such as space, are represented in the
result tree as multiple attributes. The names of these attributes
consist of the property name, followed by a period, followed by
the component name. For example <spot id="aj000035_16"/>a "space-before" property may
be specified as:</p>
<eg xml:space="preserve">
space-before.minimum="2.0pt"
space-before.optimum="3.0pt"
space-before.maximum="4.0pt"
space-before.precedence="0"
space-before.conditionality="discard"
</eg>
<p><spot id="aj000035_17"/>A short form of compound value specification may be used, in cases
where the datatype has some &lt;length&gt; components and for the
&lt;keep&gt; datatype. In the first case the
specification consists of giving a &lt;length&gt; value to an attribute
with a name matching a property name. Such a specification gives
that value to each of the &lt;length&gt; components and the initial value
to all the non-&lt;length&gt; components. For example:</p>
<eg xml:space="preserve">
space-before="4.0pt"
</eg>
<p>is equivalent to a specification of</p>
<eg xml:space="preserve">
space-before.minimum="4.0pt"
space-before.optimum="4.0pt"
space-before.maximum="4.0pt"
space-before.precedence="0"
space-before.conditionality="discard"
</eg>
<note><p><spot id="jm010009_2c"/>Since a &lt;percentage&gt; value,
that is not interpreted as "auto",
is a valid &lt;length&gt; value it may be used in a short form.</p></note>
<p>For the &lt;keep&gt; datatype the
specification consists of giving a value that is valid for a component
to an attribute
with a name matching a property name. Such a specification gives
that value to each of the components.
For example:</p>
<eg xml:space="preserve">
keep-together="always"
</eg>
<p>is equivalent to a specification of</p>
<eg xml:space="preserve">
keep-together.within-line="always"
keep-together.within-colums="always"
keep-together.within-page="always"
</eg>
<p>Short forms may be used together with complete forms; the complete
forms <spot id="c11i38"/>have precedence over the expansion of a short form.
For example:</p>
<eg xml:space="preserve">
space-before="4.0pt"
space-before.maximum="6.0pt"
</eg>
<p>is equivalent to a specification of</p>
<eg xml:space="preserve">
space-before.minimum="4.0pt"
space-before.optimum="4.0pt"
space-before.maximum="6.0pt"
space-before.precedence="0"
space-before.conditionality="discard"
</eg>
<p>Compound values of properties are inherited as a unit and not
as individual components.
<spot id="fo_sg_02"/>After inheritance any complete form specification
for a component is used to set its value.
</p>
<p>If the computed value of a corresponding relative property is
set from the corresponding absolute property, the latter is used
in determining all the components of the former.</p>
<note><p>For example, assuming a block-progression-direction of
"top-to-bottom", in a specification of</p>
<eg xml:space="preserve">
margin-top="10.0pt"
space-before.minimum="4.0pt"
</eg>
<p>the explicit setting of one of the components of the corresponding
relative property will have no effect.</p>
</note>
<p>The following defines the syntax for specifying the
datatypes usable in property values:</p>


<glist>
<gitem>
<label>&lt;integer&gt;</label>
<def><p>A signed integer value which consists of an optional '+' or '-'
character followed by a sequence of digits.
A property may define additional constraints on the value.
</p>
<note><p><spot id="od000171_1"/>A '+' sign is allowed for CSS2 compatibility.</p>
</note>
</def>
</gitem>
<gitem>
<label>&lt;number&gt;</label>
<def><p>A signed real number which consists of an optional '+' or '-'
character followed by a sequence of digits followed by an optional '.'
character and sequence of digits.
A property may define additional constraints on the value.
</p></def>
</gitem>
<gitem>
<label>&lt;length&gt;</label>
<def><p>A signed length value where a 'length' is a real number plus a unit
qualification.
A property may define additional constraints on the value.
</p></def>
</gitem>
<gitem>
<label>&lt;length-range&gt;</label>
<def><p>A compound datatype, with components:
minimum, optimum, maximum. Each component is a &lt;length&gt;.
If "minimum" is greater than optimum, it will be treated as if it had
been set to "optimum".
If "maximum" is less than optimum, it will be treated as if it had
been set to "optimum".
A property may define additional constraints on the values.
</p></def>
</gitem>
<gitem>
<label>&lt;length-conditional&gt;</label>
<def><p>A compound datatype, with components:
length, conditionality. The length component is a &lt;length&gt;.
The conditionality component is either "discard" or "retain".
A property may define additional constraints on the values.
</p></def>
</gitem>
<gitem>
<label>&lt;length-bp-ip-direction&gt;</label>
<def><p>A compound datatype, with components:
block-progression-direction, and inline-progression-direction.
Each component is a &lt;length&gt;.
A property may define additional constraints on the values.
</p></def>
</gitem>
<gitem>
<label>&lt;space&gt;</label>
<def><p>A compound datatype, with components:
minimum, optimum, maximum, precedence, and conditionality.
The minimum, optimum, and maximum components are &lt;length&gt;s.
The precedence component is either "force" or an &lt;integer&gt;.
The conditionality component is either "discard" or "retain".
If "minimum" is greater than optimum, it will be treated as if it had
been set to "optimum".
If "maximum" is less than optimum, it will be treated as if it had
been set to "optimum".
</p></def>
</gitem>
<gitem>
<label>&lt;keep&gt;</label>
<def><p>A compound datatype, with components:
within-line, within-column, and within-page. The value of each
component is either "auto", "always", or an &lt;integer&gt;.
</p></def>
</gitem>
<gitem>
<label>&lt;angle&gt;</label>
<def><p>A representation of an angle consisting of
an optional '+' or  '-' character immediately followed by
a &lt;number&gt; immediately followed by an angle unit identifier.
Angle unit identifiers are:
'deg' (for degrees),
'grad' (for grads), and
'rad' (for radians).
The specified values are normalized to the range 0deg to 360deg.
A property may define additional constraints on the value.
</p></def>
</gitem>
<gitem>
<label>&lt;percentage&gt;</label>
<def><p>A signed real percentage which consists of an optional '+' or '-'
character followed by a sequence of digits followed by an optional '.'
character and sequence of digits followed by '%'.
A property may define additional constraints on the value.
</p></def>
</gitem>
<gitem>
<label>&lt;character&gt;</label>
<def><p>A single Unicode character.</p></def>
</gitem>
<gitem>
<label>&lt;string&gt;</label>
<def><p>A sequence of characters.
</p></def>
</gitem>
<gitem>
<label>&lt;name&gt;</label>
<def><p>A string of characters representing a name.
<spot id="aj000035_18"/>It must conform to the definition of an
<xnt href="http://www.w3.org/TR/REC-xml-names/#NT-NCName" show="new" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">NCName</xnt> in
<bibref ref="XMLNAMES"/>.
</p></def>
</gitem>
<gitem>
<label>&lt;family-name&gt;</label>
<def><p>A string of characters identifying a font.
</p></def>
</gitem>
<gitem>
<label>&lt;color&gt;</label>
<def><p>Either a string of characters representing a keyword or a color
function defined in <specref ref="expr-color-functions"/>.
The list of keyword color names is:
aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive,
purple, red, silver, teal, white, and yellow.</p>
</def>
</gitem>
<gitem>
<label>&lt;country&gt;</label>
<def><p>A string of characters conforming to an ISO 3166 country code.
</p></def>
</gitem>
<gitem>
<label>&lt;language&gt;</label>
<def><p>A string of characters conforming to the
ISO 639 3-letter code.
</p></def>
</gitem>
<gitem>
<label>&lt;script&gt;</label>
<def><p>A string of characters conforming to an
ISO 15924 script code.
</p></def>
</gitem>
<gitem>
<label>&lt;id&gt;</label>
<def><p>A string of characters conforming
to the definition of an
<spot id="od000171_2a"/><xnt href="http://www.w3.org/TR/REC-xml-names/#NT-NCName" show="new" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">NCName</xnt> in
<bibref ref="XMLNAMES"/>
and is unique within the stylesheet.
</p></def>
</gitem>
<gitem>
<label>&lt;idref&gt;</label>
<def><p>A string of characters conforming
to the definition of an
<spot id="od000171_2b"/><xnt href="http://www.w3.org/TR/REC-xml-names/#NT-NCName" show="new" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">NCName</xnt> in
<bibref ref="XMLNAMES"/> and
that matches an ID property value used within the stylesheet.
</p></def>
</gitem>
<gitem>
<label>&lt;uri-specification&gt;</label>
<def><p>A sequence of characters that is <spot id="aj000035_19a"/>
"url(", followed by optional
<spot id="jm010109_7bi"/>white space, followed by an optional single quote
(') or double quote (") character, followed by
a <spot id="jm010109_39"/>URI reference as defined in <bibref ref="RFC2396"/>,
followed by an optional single quote (') or double quote (")
character, followed by optional <spot id="jm010109_7bj"/>white space, followed by
")". The two quote characters must be the same and must both be
present or absent. If the URI reference contains a single quote, the
two quote characters must be present and be double quotes.
</p></def>
</gitem>
<gitem>
<label>&lt;time&gt;</label>
<def><p><spot id="fo_sg_01a"/>A &lt;number&gt; immediately followed by a time unit identifier.
Time unit identifiers are: 'ms' (for milliseconds) and 's' (for seconds).</p>
</def>
</gitem>
<gitem>
<label>&lt;frequency&gt;</label>
<def><p><spot id="fo_sg_01b"/>A &lt;number&gt; immediately followed by a frequency unit identifier.
Frequency unit identifiers are: 'Hz' (for Hertz) and 'kHz' (for kilo Hertz).</p>
</def>
</gitem>

</glist>
</div2>


</div1>



<div1 id="fo-section"><head>Formatting Objects</head>

<div2><head>Introduction to Formatting Objects</head>
<p>
The refined formatting object tree describes one or more
intended presentations of
the information within this tree. Formatting is the process
which converts the description into a presentation. See
<specref ref="fo-jc-intro"/>. <spot id="c11i39"/>The presentation
is represented, abstractly, by an area tree, as defined in
the area model.  See <specref ref="area_model"/>.
Each possible presentation
is represented by one or more area trees in which the information in
the refined formatting object tree is positioned on a two
and one-half dimensional surface.</p>
<p>
There are three kinds of formatting objects: (1) those that generate
areas, (2) those that return areas, but do not generate
them, and (3) those that are used in the generation of
areas. The first and second kinds are typically called
<term>flow objects</term>. The third kind is either a
<term>layout object</term> or an <term>auxiliary
object</term>. The
kind of formatting object is indicated by the terminology used with
the object. Formatting objects of the first kind are said to "generate
one or more areas". Formatting objects of the second kind are said to
"return one or more areas". Formatting objects of the first kind may
both generate and return areas. Formatting objects of the third kind
are "used in the generation of areas"; that is, they act like
parameters to the generation process.
</p>
<div3 id="define-returned-by">
<head>Definitions Common to Many Formatting Objects</head>

<p>
This categorization leads to defining two traits which characterize
the relationship between an area and the formatting objects which
generate and return that area. These traits are
<trait>generated-by</trait> and
<trait>returned-by</trait>.
</p>

<p>
The value of the <trait>generated-by</trait> trait is a
single formatting
object. A formatting object <var>F</var> is defined to
<term>generate</term> an area <var>A</var>
if the semantics of <var>F</var> specify the generation of
one or more areas and <var>A</var> is one of the areas thus
generated, or is a substituted form of one of the areas thus
generated, as specified in section <specref ref="area-linebuild"/>.</p>
<p>In the case of substituted glyph-areas, the generating formatting
object is deemed to be the formatting object which generated the
glyph-area which comes first in the sequence of substituted
glyph-areas. In the case of an inserted glyph-area (e.g., an
automatically-generated hyphen) the generating formatting object is
deemed to be the generating formatting object of the last glyph-area
preceding the inserted glyph-area in the pre-order
traversal of the area tree.
</p>
<p>
The value of the <trait>returned-by</trait> trait is a set
of pairs, where each
pair consists of a formatting object and a positive integer. The
integer represents the position of the area in the ordering of all
areas returned by the formatting object.
</p>
<p>
A formatting object <var>F</var> is defined to <term>return
the sequence of
areas</term> <var>A</var>, <var>B</var>, <var>C</var>, ... if
the pair
(<var>F</var>,1) is a member of the
<trait>returned-by</trait> trait of <var>A</var>, the pair
(<var>F</var>,2) is a member of the
<trait>returned-by</trait> trait of <var>B</var>, the pair
(<var>F</var>,3) is a member of the
<trait>returned-by</trait> trait of <var>C</var>, ...
</p>
<p>
If an area is a member of the sequence of areas returned by a
formatting object, then either it was generated by the formatting
object or it was a member of the sequence of areas returned by a child
of that formatting object. Not all areas returned by a child of a
formatting object need be returned by that formatting object. A
formatting object may generate an area that has, as some of
its children areas, areas returned by the children of that
formatting
object. These children (in the area tree) of the generated area are
not returned by the formatting object to which they were returned.
</p>
<p>
A set of nodes in a tree is a <term>lineage</term> if:
</p>
<ulist>
<item><p>
there is a node <var>N</var> in the set such that all the
nodes in the set are ancestors of <var>N</var>, and</p>
</item>
<item><p>
for every node <var>N</var> in the set, if the set contains
an ancestor of <var>N</var>, it also contains the parent of
<var>N</var>.</p>
</item>
</ulist>
<p>
The set of formatting objects that an area is returned by is a <term>lineage</term>.
</p>
<p>
Areas returned by a formatting object may be either
<term>normal</term> or
<term>out-of-line</term>. Normal areas represent areas in
the
"normal flow
of text"; that is, they become area children of the areas generated by
the formatting object to which they are returned. Normal areas have a
<trait>returned-by</trait> lineage of size one. There is
only one kind of normal area.
</p>
<p>
Out-of-line areas are areas used outside the normal flow of text
either because <spot id="aj000035_20"/>they are absolutely positioned or they are part of a
float or footnote. Out-of-line areas may have a
<trait>returned-by</trait> lineage of size greater than one.
</p>
<p>
The <trait>area-class</trait> trait indicates which class,
normal or
out-of-line, an area belongs to. For out-of-line areas, it also
indicates the subclass of out-of-line area. The values for this trait
are: <spot id="jf000082_2a"/>"xsl-normal", "xsl-absolute", "xsl-footnote",
"xsl-side-float", or "xsl-before-float".
An area
is normal if and only if the value of the
<trait>area-class</trait> trait is
<spot id="jf000082_2b"/>"xsl-normal"; otherwise, the area is an out-of-line
area. (See section <specref ref="area-stackcon"/>.)</p>
<p>
The areas <term>returned-by</term> a given formatting object are ordered as
noted above. This ordering defines an ordering on the sub-sequence of
areas that are of a given <term>area-class</term>, such as the sub-sequence
of normal areas. An area <var>A</var> precedes an area <var>B</var> in the sub-sequence if
and only if area <var>A</var> precedes area <var>B</var> in the areas <term>returned-by</term> the
formatting objects.
</p>
<p><spot id="fo01jr_6a"/>A <term>reference-area chain</term>
is defined as a sequence
of reference-areas that is either generated by the same formatting
object that is not a page-sequence formatting object, or that consists
of the region reference-areas or normal-flow-reference-areas
(see <specref ref="fo_region-body"/>)
generated using region formatting objects assigned to the same
flow (see <specref ref="fafm"/>).
The reference-areas in the sequence are said
to be "contained" by the reference-area chain, and they have the
same ordering relative to each other in the sequence as they have
in the area tree, using pre-order traversal order of the area tree.</p>
</div3>
</div2>

<div2><head>Formatting Object Content</head>
<p>The content of a formatting object is described using XML
content-model syntax. In some cases additional constraints, not expressible
in XML content models, are given in prose.</p>

<p id="block.fo.list">The parameter entity, "%block;" in the content models below,
contains the following formatting objects:</p>
<eg xml:space="preserve">
     block
     block-container
     table-and-caption
     table
     list-block
</eg>
<p id="inline.fo.list">The parameter entity, "%inline;" in the content models below,
contains the following formatting objects:</p>
<eg xml:space="preserve">
     bidi-override
     character
     external-graphic
     instream-foreign-object
     inline
     inline-container
     leader
     page-number
     page-number-citation
     basic-link
     multi-toggle
</eg>
<p>The following formatting objects are "neutral" containers and
may be used,
provided that the additional constraints listed
under each formatting object are satisfied,
anywhere where #PCDATA, %block;, or %inline; are allowed:</p>
<eg xml:space="preserve">
     multi-switch
     multi-properties
     wrapper
     retrieve-marker
</eg>
<p>The following "out-of-line" formatting objects
may be used anywhere where #PCDATA, %block;, or %inline; are allowed
<spot id="aj000035_21"/>(except as a descendant of any "out-of-line"
formatting object):</p>
<eg xml:space="preserve">
     float
</eg><p>The following "out-of-line" formatting objects
may be used anywhere where #PCDATA or %inline; are allowed
(except as a descendant of any "out-of-line"
formatting object):</p>
<eg xml:space="preserve">
     footnote
</eg>
</div2>

<div2><head>Formatting Objects Summary</head>
<glist>
<gitem><label>basic-link</label>
<def><p><spot id="link01_i5d"/>The fo:basic-link is used for representing the start resource of a simple
link.</p></def>
</gitem>
<gitem><label>bidi-override</label>
<def><p>The fo:bidi-override inline formatting object is used
where it is necessary to override the default
<spot id="jm010109_40"/>Unicode-bidirectional-algorithm
direction for different (or nested) inline scripts
in mixed-language documents.</p></def>
</gitem>
<gitem><label>block</label>
<def><p>The fo:block formatting object is commonly used for formatting paragraphs,
titles, headlines, figure and table captions,
etc.</p></def>
</gitem>
<gitem><label>block-container</label>
<def><p>The fo:block-container flow object is used to
generate a block-level reference-area.</p></def>
</gitem>
<gitem><label>character</label>
<def><p>The fo:character flow object represents a character that
is mapped to
a glyph for presentation.</p></def>
</gitem>
<gitem><label>color-profile</label>
<def><p>Used to declare a color profile for a stylesheet.</p></def>
</gitem>
<gitem><label>conditional-page-master-reference</label>
<def><p>The fo:conditional-page-master-reference is used to identify a
page-master that is to be used when the conditions on its use are
satisfied.</p></def>
</gitem>
<gitem><label>declarations</label>
<def><p>Used to group global declarations for a stylesheet.</p></def>
</gitem>
<gitem><label>external-graphic</label>
<def><p>The fo:external-graphic flow object is used for a
<spot id="aj000035_29a"/>graphic where the graphics data resides outside of the
<spot id="c11i40"/>XML result tree in the fo namespace.</p></def>
</gitem>
<gitem><label>float</label>
<def><p>
The fo:float serves two purposes. It can be used so that during the normal
placement of content, some related content is formatted into a separate area
at beginning of the page (or of some following page) where it is available
to be read without immediately intruding on the reader.
Alternatively, it can be used when an area is intended to float
to one side, with normal content flowing alongside.
</p></def>
</gitem>
<gitem><label>flow</label>
<def><p>The content of the fo:flow formatting object is a
sequence of
flow objects that provides the flowing text content that is
distributed into pages.</p></def>
</gitem>
<gitem><label>footnote</label>
<def><p>The fo:footnote is used to produce a footnote citation and the corresponding footnote.</p></def>
</gitem>
<gitem><label>footnote-body</label>
<def><p>The fo:footnote-body is used to generate the content of the footnote.</p></def>
</gitem>
<gitem><label>initial-property-set</label>
<def><p>The fo:initial-property-set specifies formatting properties
for the first line of an fo:block.</p></def>
</gitem>
<gitem><label>inline</label>
<def><p>The fo:inline formatting object is commonly used for formatting
a portion of text with a background or enclosing it in a border.
</p></def>
</gitem>
<gitem><label>inline-container</label>
<def><p>The fo:inline-container flow object is used to
generate an inline reference-area.</p></def>
</gitem>
<gitem><label>instream-foreign-object</label>
<def><p>The fo:instream-foreign-object flow object is used for an inline
graphic or other "generic" object
where the object data resides as descendants of the
fo:instream-foreign-object.</p></def>
</gitem>
<gitem><label>layout-master-set</label>
<def><p>The fo:layout-master-set is a wrapper around all masters used in the
document.</p></def>
</gitem>
<gitem><label>leader</label>
<def><p>The fo:leader formatting object is used to generate leaders consisting
either of a rule or of a row of a repeating character or cyclically
repeating pattern of characters that may be used for connecting two
text formatting objects.</p></def>
</gitem>
<gitem><label>list-block</label>
<def><p>The fo:list-block flow object is used to format a list.</p></def>
</gitem>
<gitem><label>list-item</label>
<def><p>The fo:list-item formatting object contains the label and the
body of an item in a list.</p></def>
</gitem>
<gitem><label>list-item-body</label>
<def><p>The fo:list-item-body formatting object contains the
content
of the body of a list-item.</p></def>
</gitem>
<gitem><label>list-item-label</label>
<def><p>The fo:list-item-label formatting object contains the
content
of the label of a list-item; typically used to either enumerate,
identify, or adorn the list-item's body.</p></def>
</gitem>
<gitem><label>marker</label>
<def><p>The fo:marker is used in conjunction with
fo:retrieve-marker to produce running headers or footers.</p></def>
</gitem>
<gitem><label>multi-case</label>
<def><p><spot id="aj000035_23a"/>The fo:multi-case is used to contain (within
an fo:multi-switch) each alternative sub-tree of formatting
objects among which the parent fo:multi-switch will choose
one to show and will hide the rest.</p></def>
</gitem>
<gitem><label>multi-properties</label>
<def><p>The fo:multi-properties is used to switch between two or more property sets that
are associated with a given portion of content.
</p></def>
</gitem>
<gitem><label>multi-property-set</label>
<def><p>
The fo:multi-property-set is used to specify an alternative
set of formatting
properties that, dependent on a User Agent state, are applied to the content.
</p></def>
</gitem>
<gitem><label>multi-switch</label>
<def><p><spot id="aj000035_22a"/>The fo:multi-switch wraps the specification of
alternative sub-trees of formatting objects (each sub-tree
being within an fo:multi-case), and controls the switching
(activated via fo:multi-toggle) from one alternative to
another.</p></def>
</gitem>
<gitem><label>multi-toggle</label>
<def><p>The fo:multi-toggle is used within an fo:multi-case to
switch to another
fo:multi-case.</p></def>
</gitem>
<gitem><label>page-number</label>
<def><p>The fo:page-number formatting object is used to represent
the
current page-number.</p></def>
</gitem>
<gitem><label>page-number-citation</label>
<def><p>The fo:page-number-citation is used to reference the
page-number for the page containing the first normal
area returned by the cited formatting
object.</p></def>
</gitem>
<gitem><label>page-sequence</label>
<def><p>The fo:page-sequence formatting object is used to specify how to
create a (sub-)sequence of pages within a document; for example, a
chapter of a report. The content of these pages comes from flow
children of the fo:page-sequence.</p></def>
</gitem>
<gitem><label>page-sequence-master</label>
<def><p>The fo:page-sequence-master specifies sequences of page-masters
that are used when generating a sequence of pages.
</p></def>
</gitem>
<gitem><label>region-after</label>
<def><p>This region defines
a viewport that is located on the "after" side of fo:region-body
region.</p></def>
</gitem>
<gitem><label>region-before</label>
<def><p>This region defines
a viewport that is located on the "before" side of fo:region-body
region.</p></def>
</gitem>
<gitem><label>region-body</label>
<def><p>This region specifies a
viewport/reference pair that is located in the "center" of the
fo:simple-page-master.</p></def>
</gitem>
<gitem><label>region-end</label>
<def><p>This region defines
a viewport that is located on the "end" side of fo:region-body region.</p></def>
</gitem>
<gitem><label>region-start</label>
<def><p>This region defines
a viewport that is located on the "start" side of fo:region-body
region.</p></def>
</gitem>
<gitem><label>repeatable-page-master-alternatives</label>
<def><p>An
fo:repeatable-page-master-alternatives
specifies a sub-sequence consisting of
repeated instances of a set of alternative page-masters.
The number of repetitions may be bounded or
potentially unbounded.</p></def>
</gitem>
<gitem><label>repeatable-page-master-reference</label>
<def><p>An
fo:repeatable-page-master-reference
specifies a sub-sequence consisting of
repeated instances of a single page-master. The number of repetitions
may be bounded or potentially unbounded.</p></def>
</gitem>
<gitem><label>retrieve-marker</label>
<def><p>The fo:retrieve-marker is used in
conjunction with fo:marker to produce running headers or footers.</p></def>
</gitem>
<gitem><label>root</label>
<def><p>The fo:root node is the top node of an XSL result tree.
This tree is composed of formatting objects.</p></def>
</gitem>
<gitem><label>simple-page-master</label>
<def><p>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 <spot id="c11i41"/>regions.</p></def>
</gitem>
<gitem><label>single-page-master-reference</label>
<def><p>An fo:single-page-master-reference specifies a sub-sequence consisting
of a single instance of a single page-master.</p></def>
</gitem>
<gitem><label>static-content</label>
<def><p>The
fo:static-content formatting object holds a sequence or a
tree of
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. </p></def>
</gitem>
<gitem><label>table</label>
<def><p>The fo:table flow object is used for formatting the
tabular material
of a table.</p></def>
</gitem>
<gitem><label>table-and-caption</label>
<def><p>The fo:table-and-caption flow object is used for
formatting a table
together with its caption.</p></def>
</gitem>
<gitem><label>table-body</label>
<def><p>The fo:table-body formatting object is used to contain
the content
of the table body.</p></def>
</gitem>
<gitem><label>table-caption</label>
<def><p><spot id="aj000035_24a"/>The fo:table-caption formatting object
is used to contain block-level formatting objects containing
the caption for the table only when using the fo:table-and-caption. </p></def>
</gitem>
<gitem><label>table-cell</label>
<def><p>The fo:table-cell formatting object is used to group
content to be
placed in a <spot id="c11i42_a"/>table cell.</p></def>
</gitem>
<gitem><label>table-column</label>
<def><p>The fo:table-column formatting object specifies
characteristics
applicable to table cells that have the same column and span.</p></def>
</gitem>
<gitem><label>table-footer</label>
<def><p>The fo:table-footer formatting object is used to contain
the content
of the table footer.</p></def>
</gitem>
<gitem><label>table-header</label>
<def><p>The fo:table-header formatting object is used to contain
the content
of the table header.</p></def>
</gitem>
<gitem><label>table-row</label>
<def><p>The fo:table-row formatting object is used to group
table-cells into
rows.</p></def>
</gitem>
<gitem><label>title</label>
<def><p>
The fo:title formatting object is used to associate a title with a
given page-sequence. This title may be used by an interactive User Agent to
identify the pages. For example, the content of the fo:title can be
formatted and displayed in a "title" window or in a "tool tip".
</p></def>
</gitem>
<gitem><label>wrapper</label>
<def><p>The fo:wrapper formatting object is used to
specify
inherited properties for a group of formatting objects.
It has no additional formatting semantics.</p></def>
</gitem>
</glist>
</div2>





<div2>
<head>Declarations and Pagination and Layout Formatting Objects</head>

<div3 id="pag-intro"><head>Introduction</head>
<p>The root node of the formatting object tree must be an
fo:root
formatting object.  The children of the fo:root formatting object are
a single fo:layout-master-set, an optional fo:declarations,
and a sequence of one or more
fo:page-sequences. The fo:layout-master-set defines the geometry and
sequencing of the pages; the children of the fo:page-sequences, which
are called <term>flows</term> (contained in fo:flow and
fo:static-content), provide the content that is distributed
into the pages. The fo:declarations object is a wrapper for formatting objects
whose content is to be used as a resource to the formatting
process. The process of generating the pages is done automatically
by the XSL processor formatting the result tree.
</p>
<p>The children of the fo:layout-master-set are the pagination and layout
specifications. The names of these specifications end in
"-master". There are two types of pagination and layout
specifications: page-masters and page-sequence-masters.  Page-masters
have the role of describing the intended subdivisions of a page and
the geometry of these subdivisions.  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.
</p>
<div4><head>Page-sequence-masters</head>
<p>Each fo:page-sequence-master characterizes a set of possible sequences
of page-masters. For any given fo:page-sequence, only one of the
possible set of sequences will be used. The sequence that is used is
any sequence that satisfies the constraints determined by
the individual page-masters, the flows which generate pages from the
page-masters, and the fo:page-sequence-master itself.
</p>
<p>The fo:page-sequence-master is used to determine which page-masters
are used and in which order. The children of the
fo:page-sequence-master are a sequence of sub-sequence specifications.
The page-masters in a sub-sequence may be specified by a reference
to a single page-master or as a repetition of one or more
page-masters. For example, a sequence might begin with several
explicit page-masters and continue with a repetition of some other
page-master (or masters).
</p>
<p>The fo:single-page-master-reference is used to specify a sub-sequence
consisting of a single page-master.
</p>
<p>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.
</p>
</div4>
<div4><head>Page-masters</head> <p>A page-master is a master that is
used to generate a <term>page</term>. A page is a viewport/reference
pair in which the viewport-area is a child of the area tree
root.  A <term>page-viewport-area</term> is defined to be the viewport-area of a
page, and a <term>page-area</term> is defined to be the unique child of a
page-viewport-area.
</p>
<p>
The page-viewport-area is defined by the output medium; the page-area
holds the page contents and has the <spot id="aj000035_25"/>effect of positioning the page
contents on the output medium.
</p>
<p>A single page-master may be used multiple times. Each time it is used
it generates a single page; for example, a page-master that is
referenced from an fo:repeatable-page-master-reference will be used
by the fo:page-sequence to generate
one page for each occurrence of the reference in the specified
sub-sequence.
</p>
<note>
<p>When pages are used with a User Agent such as a Web
browser, it is common that the each document has only one
page. The
viewport used to view the page determines the size of the page. When
pages are placed on non-interactive media, such as sheets of paper,
pages correspond to one or more of the surfaces of the paper. The size
of the paper determines the size of the page.</p>
</note>
<p>In this specification, there is only one kind of page-master, the
fo:simple-page-master. Future versions of this specification may add
additional kinds of page-masters.
</p>
<p>An fo:simple-page-master has, as children, specifications for one or more
regions.
</p>
<p>A region specification is used as a master, the <term>region-master</term>,
in generating viewport/reference pair consisting of a
<term>region-viewport-area</term> and a <term>region-reference-area</term>.
The region-viewport-area is always a child
of a page-area generated using the parent of the region-master.
</p>
<note>
<p>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. For languages with a lr-tb
(or rl-tb) writing-mode, this region is typically of indefinite length
in the top-to-bottom direction. 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.
</p>
</note>
<p>Each region is defined by a region formatting object. Each
region formatting object has a name and a definite position. In
addition, the region's height or width is fixed and the other
dimension may be either fixed or indefinite. For example, a region
that is the body of a Web page may have indefinite height.
</p>
<p>The specification of the region determines the size and position of
region-viewport-areas generated using the region formatting object.
The positioning of the viewport is relative to its page-area parent.
</p>
<p>For  version 1.0 of this <spot id="jm010109_10b"/>Recommendation, a page-master will
consist of up to five regions: "region-body" and four other regions,
one on each side of the body. To allow the side regions to correspond
to the current writing-mode, these regions are named "region-before"
(which corresponds to "header" in the "lr-tb" writing-mode),
"region-after" (which corresponds to "footer" in the "lr-tb"
writing-mode), "region-start" (which corresponds to a "left-sidebar"
in the "lr-tb" writing-mode) and "region-end" (which corresponds
to a "right-sidebar" in the "lr-tb" writing-mode).  It is
<spot id="c11i43"/>expected that a future version of the <spot id="jm010109_10c"/>Recommendation will introduce a
mechanism that allows a page-master to contain an arbitrary number of
arbitrarily sized and positioned regions.</p>
<p>Some types of region have conditional sub-regions associated with them, and the
associated region-reference-areas are divided up by having child areas
corresponding to the sub-regions, including a "main-reference-area" for
the region.
<spot id="fosg_2b"/>For region-masters to which
the column-count property applies,
the main-reference-area is further subdivided by having child-areas
designated as "span-reference-areas" whose number depends upon the
number of spans (i.e. block-areas with span="all")
occurring on the page. These in turn are subdivided by having
child-areas designated as "normal-flow-reference-areas",
whose number depends on the number of columns specified.</p>
</div4>
<div4><head>Page Generation</head> <p>
Pages are generated by the formatter's processing of fo:page-sequences.
As noted above, each page is a viewport/reference pair in which the
viewport-area is a child of the area tree root. Each page is generated using
a page-master to define the region-viewport-areas
and region-reference-areas that correspond to the regions specified by
that page-master.
</p>
<p>Each fo:page-sequence references either an fo:page-sequence-master or
a page-master. If the reference is to a 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. <spot id="c11i44"/>An fo:page-sequence references a page-master if
either the fo:page-sequence directly references the page-master via
the "master-reference" property or that property references an
fo:page-sequence-master that references the page-master.
</p>
</div4>
<div4 id="fafm"><head>Flows and Flow Mapping</head>
<p>There are two kinds of <term>flows</term>: 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 processing of the fo:flow flow is what determines how many
pages are generated to hold the fo:page-sequence. The
fo:page-sequence-master is used as the generator of the sequence of
page-masters into which the flow children content is distributed.
</p>
<p>The children of a flow are a sequence of block-level flow objects.
Each flow has a name that is given by its "flow-name" property.
No two flows may have the same name.</p>
<p>The assignment of flows to regions on a page-master is determined by
a <term>flow-map</term>.  The flow-map is an association
between the flow children of the fo:page-sequence and regions defined
within the page-masters referenced by that fo:page-sequence.
</p>
<p>In version 1.0 of this <spot id="jm010109_10d"/>Recommendation, the flow-map is implicit. The
"flow-name" property of a flow specifies to which region
that flow is assigned.  Each region has a "region-name"
property. The implicit flow-map assigns a flow to the region that has
the same name. In future versions of XSL, the flow-map is
expected to become an explicit formatting object.
</p>
<p>To avoid requiring users to generate region-names, the regions all
have default values for the "region-name" property.  The region-body,
region-before, region-after, region-start, and region-end have the
default names "xsl-region-body", "xsl-region-before", "xsl-region-after",
"xsl-region-start", and "xsl-region-end", respectively.
</p>
<p>In addition, an fo:static-content formatting object may
have a <spot id="jm010041"/>"flow-name" property value of "xsl-before-float-separator" or
"xsl-footnote-separator".  If a conditional sub-region of the
region-body
is used to generate a reference-area on a particular page, the
fo:static-content whose name corresponds to the conditional
sub-region shall be formatted into the reference-area associated
with the sub-region, as specified in section <specref ref="pg-out-of-line"/>.
</p></div4>
<div4><head>Constraints on Page Generation</head>
<p>The areas that are descendants of a page-area are constrained by the
page-master used to generate the page-area and the flows that are assigned
to the regions specified on the page-master. For
fo:flow flows, the areas generated by the descendants of the flow are
distributed across the pages in the sequence that were generated using
page-masters having the region to which the flow is assigned. For
fo:static-content
flows, the processing of the flow is repeated for each page generated
using a page-master having the region to which the flow is assigned
<spot id="c11i45"/>with two exceptions:
for a fo:static-content with a <trait>flow-name</trait> of
<code role="value">xsl-before-float-separator</code>, the processing
is repeated only for those page-reference-areas which have descendant
areas with an area-class of <code role="value">xsl-before-float</code>,
and for a fo:static-content with a <trait>flow-name</trait> of
<code role="value">xsl-footnote-separator</code>, the processing
is repeated only for those page-reference-areas which have descendant
areas with an area-class of <code role="value">xsl-footnote</code>.</p>
</div4>
<div4><head>Pagination Tree Structure</head>
<p>The result tree structure is shown below.</p>
<figure>
<graphic source="PageTree.gif" alt="Tree representation of the Formatting Objects for pagination" longdesc="A conceptual tree representation of the structure of Formatting Objects in a document." xml:attributes="href source" show="embed" actuate="auto" xmlns:xlink="http://www.w3.org/TR/WD-xlink"/>
<figcap><p>Tree Representation of the Formatting Objects for Pagination</p></figcap>
</figure>
</div4>

</div3>


<div3 id="fo_root"><head>fo:root</head>

<p><emph>Common Usage:</emph></p>
<p>This is the top node of the formatting object tree. It holds an
fo:layout-master-set formatting object (which holds all masters used
in the document), an optional fo:declarations,
and one or more fo:page-sequence objects. Each
fo:page-sequence represents a sequence of pages that result from
formatting the content children of the fo:page-sequence.
</p>
<note><p>A document can contain multiple fo:page-sequences. For example,
each chapter of a document could be a separate fo:page-sequence; this
would allow chapter-specific content, such as the chapter
title, to be placed within a header or footer.</p>
</note>

<p><emph>Areas:</emph></p>
<p>Page-viewport-areas are returned by the fo:page-sequence children of the
fo:root formatting object. The fo:root does not generate any areas.</p>

<p><emph>Constraints:</emph></p>
<p>The children of the root of the area tree consist solely of, and totally of, the
page-viewport-areas returned by the fo:page-sequence children of the
fo:root. The set of all areas returned by the fo:page-sequence children
is <term>properly ordered</term>. (See Section <specref ref="area-genorder"/>.)
</p>

<p><emph>Contents:</emph></p>
<eg xml:space="preserve">
(<loc href="#fo_layout-master-set" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">layout-master-set</loc>,<loc href="#fo_declarations" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">declarations</loc>?,<loc href="#fo_page-sequence" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">page-sequence</loc>+)
</eg>

<p><emph>The following properties apply to this formatting object:</emph></p><slist>
<sitem><specref ref="media-usage"/></sitem>
</slist>
</div3>


<div3 id="fo_declarations"><head>fo:declarations</head>

<p><emph>Common Usage:</emph></p>
<p>The fo:declarations formatting object is used to group global declarations for a stylesheet.</p>

<p><emph>Areas:</emph></p>
<p>The fo:declarations formatting object does not generate
or return any areas.</p>

<p><emph>Constraints:</emph></p>
<p>None.</p>

<p><emph>Contents:</emph></p>
<eg xml:space="preserve">
(<loc href="#fo_color-profile" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">color-profile</loc>)+
</eg>
<p><spot id="wai_4e"/>The fo:declarations flow object may have
additional child elements in a non-XSL namespace. Their presence does not,
however, change the semantics of the XSL namespace objects and properties.
The permitted structure of these non-XSL namespace elements is defined for
their namespace(s).</p>

</div3>


<div3 id="fo_color-profile"><head>fo:color-profile</head>

<p><emph>Common Usage:</emph></p>
<p>The fo:color-profile formatting object is used to declare
an ICC Color Profile for a stylesheet.
The color-profile is referenced again via the name specified in
the "color-profile-name" property.
</p>
<p>The color-profile is identified by the URI specified in the "src"
property value.  This URI may identify an internally recognized
color-profile or it may point to a ICC Color Profile encoding
that should be loaded and interpreted. </p>
<p>When the color-profile is referenced (e.g., via the
<spot id="fo_sg_03e"/>rgb-icc function <spot id="aj000035_45b"/><specref ref="expr-color-functions"/>), the following rules are used:</p>
<olist>
<item><p>If the color-profile is available, the color value
identified from the color-profile should be used.</p></item>
<item><p>If the color-profile is not available,
the sRGB
<spot id="jm010109_42"/>(<bibref ref="sRGB"/>) fallback must be used.</p></item>
</olist>

<p><emph>Areas:</emph></p>
<p>The fo:color-profile formatting object does not generate
or return any areas.</p>

<p><emph>Constraints:</emph></p>
<p>None.</p>

<p><emph>Contents:</emph></p>
<eg xml:space="preserve">
EMPTY
</eg>

<p><emph>The following properties apply to this formatting object:</emph></p><slist>

<sitem><specref ref="src"/></sitem>
<sitem><specref ref="color-profile-name"/></sitem>
<sitem><specref ref="rendering-intent"/></sitem>
</slist>
</div3>


<div3 id="fo_page-sequence"><head>fo:page-sequence</head>

<p><emph>Common Usage:</emph></p>
<p>The fo:page-sequence formatting object is used to specify how to
create a (sub-)sequence of pages within a document; for example, a
chapter of a report. The content of these pages comes from flow
children <spot id="od000299_b"/>(consisting of the single fo:flow
and any fo:static-content flow objects)
of the fo:page-sequence. The layout of these pages comes from
the fo:page-sequence-master or page-master
referenced by the <trait>master-reference</trait>

trait on the fo:page-sequence. The sequence of areas returned by
each of the flow-object children of the fo:page-sequence are
made descendants of the generated pages as described below.

</p>

<p><emph>Areas:</emph></p>
<p>The fo:page-sequence formatting object generates a sequence of
viewport/reference pairs, and returns the page-viewport-areas.  For
each page-reference-area, and each region specified in the page-master used to
generate that page-reference-area, the fo:page-sequence object also generates
the viewport/reference pair for the occurrence of that region in that
page-reference-area, and may generate a before-float-reference-area,
footnote-reference-area,
and main-reference-area, and one or more normal-sequence-reference-areas.
The generation of these further areas is described in the descriptions
of the fo:simple-page-master and region-masters.
It may also generate a title-area.
</p>
<p>All areas generated by an fo:page-sequence have
area-class "xsl-absolute".</p>

<p><emph>Constraints:</emph></p>
<p>Each page-viewport-area/page-reference-area pair is generated using a
page-master that satisfies the constraints of the page-sequence-master
identified by the <trait>master-reference</trait> trait of the
fo:page-sequence or a page-master that was directly identified by the
<trait>master-reference</trait> trait. The
region-viewport-area children of such a page-reference-area must correspond
to the regions that are children of that page-master.
</p>
<p>The areas generated by the fo:page-sequence have as their
descendants the areas returned by the flows that are children of the
fo:page-sequence.</p>
<p>
The areas returned to the fo:page-sequence by a flow must satisfy four
types of constraints:</p>
<ulist>
<item><p><emph>Completeness</emph>.  All areas returned by formatting object
descendants of the flow children of the fo:page-sequence
become descendants of areas generated by the fo:page-sequence,
with the exception of glyph-areas subject to deletion or substitution as in Sections
<specref ref="area-linebuild"/> and <specref ref="area-inlinebuild"/>.
</p></item>
<item><p><emph>Flow-map association</emph>. All areas returned by flow
children of the fo:page-sequence become
descendants of region-reference-areas generated from column-areas
associated to the flow by the flow-map in effect, except for areas
returned from a fo:static-content with a <trait>flow-name</trait> of
<code role="value">xsl-before-float-separator</code> or
<code role="value">xsl-footnote-separator</code>.
</p>
<p>
Areas returned from an fo:static-content with a <trait>flow-name</trait> of
<code role="value">xsl-before-float-separator</code> become children of the
before-float-reference-area of an area associated to an fo:region-body,
following all sibling areas of area-class <code role="value">xsl-before-float</code>.
Areas returned from an fo:static-content with a <trait>flow-name</trait>
of <code role="value">xsl-footnote-separator</code> become children of the
footnote-reference-area of an area associated to an fo:region-body, preceding
all sibling areas of area-class <code role="value">xsl-footnote</code>.
</p></item>
<item><p><emph>Area-class association.</emph>  Areas returned by flow children of an
fo:page-sequence are distributed as follows: all areas of area-class
<code role="value">xsl-footnote</code> must be
descendants of a footnote-reference-area; areas of area-class
<code role="value">xsl-before-float</code>
must be descendants of a before-float-reference-area; all
other areas (including
normal areas) must be descendants of a main-reference-area for a region.</p></item>
<item><p><emph>Stacking</emph>.  The stackable areas of a given class returned
by children of each flow are properly stacked within the appropriate reference-area,
as described above.</p>
</item>
</ulist>
<p>If a title-area is generated the following constraints must be
satisfied:</p>
<ulist>
<item><p><emph>Completeness</emph>.  All areas returned by formatting object
descendants of the fo:title child of the fo:page-sequence
become descendants of the title-area generated by the fo:page-sequence,
with the exception of glyph-areas subject to deletion or substitution as in Sections
<specref ref="area-linebuild"/> and <specref ref="area-inlinebuild"/>.
</p></item>
<item><p><emph>Stacking</emph>.  The areas returned
by children of the fo:title are properly stacked within the title-area.</p>
</item>
</ulist>
<p>The default ordering constraint of section <specref ref="area-genorder"/>
does not apply to the
fo:page-sequence. The default ordering constraints apply to the
<spot id="od000299_a"/>flow object children inside the single fo:flow;
special ordering constraints apply to the child fo:static-content
objects.<spot id="od000280_3"/></p>

<p><emph>Contents:</emph></p>
<eg xml:space="preserve">
(<loc href="#fo_title" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">title</loc>?,<loc href="#fo_static-content" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">static-content</loc>*,<loc href="#fo_flow" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">flow</loc>)
</eg>

<p><emph>The following properties apply to this formatting object:</emph></p><slist>
<sitem><specref ref="country"/></sitem>
<sitem><specref ref="format"/></sitem>
<sitem><specref ref="language"/></sitem>
<sitem><specref ref="letter-value"/></sitem>
<sitem><specref ref="grouping-separator"/></sitem>
<sitem><specref ref="grouping-size"/></sitem>
<sitem><specref ref="id"/></sitem>
<sitem><specref ref="initial-page-number"/></sitem>
<sitem><specref ref="force-page-count"/></sitem>
<sitem><specref ref="master-reference"/></sitem>
</slist>
</div3>


<div3 id="fo_layout-master-set"><head>fo:layout-master-set</head>

<p><emph>Common Usage:</emph></p>
<p>The fo:layout-master-set is a wrapper around all masters used in the
document. This includes page-sequence-masters, page-masters, and
region-masters.</p>

<p><emph>Areas:</emph></p>
<p>The fo:layout-master-set formatting object generates no area directly.
The masters that are the children of the fo:layout-master-set are
used by the fo:page-sequence to generate pages.</p>

<p><emph>Constraints:</emph></p>
<p>The value of the <trait>master-name</trait> trait on each
child of the fo:layout-master-set must be unique within the set.
</p>

<p><emph>Contents:</emph></p>
<eg xml:space="preserve">
(<loc href="#fo_simple-page-master" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">simple-page-master</loc>|<loc href="#fo_page-sequence-master" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">page-sequence-master</loc>)+
</eg>

</div3>


<div3 id="fo_page-sequence-master"><head>fo:page-sequence-master</head>

<p><emph>Common Usage:</emph></p>
<p>
The fo:page-sequence-master is used to specify the constraints on and
the order in which a given set of page-masters will be used in
generating a sequence of pages. Pages are automatically generated when
the fo:page-sequence-master is used in formatting an fo:page-sequence.
</p>
<note>
<p>There are several ways of specifying a potential
sequence of pages.  One can specify a sequence of references to
particular page-masters. This yields a bounded sequence of potential
pages. Alternatively, one can specify a repeating sub-sequence of one
or more page-masters. This sub-sequence can be bounded or
unbounded. Finally one can intermix the two kinds of sub-sequence-specifiers.
</p>
</note>

<p><emph>Areas:</emph></p>
<p>The fo:page-sequence-master formatting object generates no area directly.
It is used by the
fo:page-sequence formatting object to generate pages.
</p>

<p><emph>Constraints:</emph></p>
<p>The children of the fo:page-sequence-master are a sequence of
<term>sub-sequence-specifiers</term>. A page-sequence
satisfies the constraint
determined by an fo:page-sequence-master if
(a) <spot id="jm010109_43"/>it can be partitioned
into a sequence of sub-sequences of pages that map one-to-one
to an initial sub-sequence of the sequence of
sub-sequence-specifiers that are the
children of the
fo:page-sequence-master and, (b) for each sub-sequence of pages
in the partition, that
sub-sequence satisfies the constraints of the corresponding
sub-sequence-specifier.
The
sequence of sub-sequences of pages can be shorter than the sequence of
sub-sequence-specifiers.
</p>
<p>It is an error if the entire sequence of sub-sequence-specifiers children is
exhausted while some areas returned by an fo:flow are not placed.  Implementations
may recover, if possible, by re-using the sub-sequence-specifier that was last
used to generate a page.
</p>

<p><emph>Contents:</emph></p>
<eg xml:space="preserve">
(<loc href="#fo_single-page-master-reference" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">single-page-master-reference</loc>|<loc href="#fo_repeatable-page-master-reference" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">repeatable-page-master-reference</loc>|<loc href="#fo_repeatable-page-master-alternatives" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">repeatable-page-master-alternatives</loc>)+
</eg>

<p><emph>The following properties apply to this formatting object:</emph></p><slist>
<sitem><specref ref="master-name"/></sitem>
</slist>
</div3>


<div3 id="fo_single-page-master-reference"><head>fo:single-page-master-reference</head>

<p><emph>Common Usage:</emph></p>
<p>An fo:single-page-master-reference is the
simplest sub-sequence-specifier. It specifies a sub-sequence consisting
of a single instance of a single page-master. It is used to specify
the use of a particular page-master at a given point in the sequence
of pages that would be generated using the fo:page-sequence-master
that is the parent of the fo:single-page-master-reference.
</p>

<p><emph>Areas:</emph></p>
<p>The fo:single-page-master-reference formatting object generates no area directly.
It is used by the fo:page-sequence formatting
object to generate pages.
</p>

<p><emph>Constraints:</emph></p>
<p>The fo:single-page-master-reference has a reference to the
fo:simple-page-master which has the same master-name as the
<trait>master-reference</trait> trait on the
fo:single-page-master-reference.
</p>
<p>The sub-sequence of pages mapped to this
sub-sequence-specifier satisfies
the constraints of this sub-sequence-specifier if (a) the
sub-sequence of pages consists of a single page and (b) that page is
constrained to have been generated using the fo:simple-page-master
referenced by the fo:single-page-master-reference.<spot id="od000280_4"/>
</p>

<p><emph>Contents:</emph></p>
<eg xml:space="preserve">
EMPTY
</eg>

<p><emph>The following properties apply to this formatting object:</emph></p><slist>
<sitem><specref ref="master-reference"/></sitem>
</slist>
</div3>


<div3 id="fo_repeatable-page-master-reference"><head>fo:repeatable-page-master-reference</head>

<p><emph>Common Usage:</emph></p>
<p>An fo:repeatable-page-master-reference is the next simplest
sub-sequence-specifier. It specifies a sub-sequence
consisting of
repeated instances of a single page-master. The number of repetitions
may be bounded or potentially unbounded.
</p>

<p><emph>Areas:</emph></p>
<p>The fo:repeatable-page-master-reference formatting object generates no area directly.
It is used by the fo:page-sequence formatting object to generate
pages.
</p>

<p><emph>Constraints:</emph></p>
<p>The fo:repeatable-page-master-reference has a reference to the
fo:simple-page-master which has the same master-name as the
<trait>master-reference</trait> trait on the
fo:repeatable-page-master-reference.
</p>
<p>The sub-sequence of pages mapped to this
sub-sequence-specifier satisfies
the constraints of this sub-sequence-specifier if (a) the
sub-sequence of pages <spot id="c11i47"/>consists of zero or more pages, (b) each page is
generated using the fo:simple-page-master
referenced by the fo:repeatable-page-master-reference, and (c) length of
the sub-sequence is less than or equal to the value of <trait>maximum-repeats</trait>.
</p>
<p>If no region-master child of the fo:repeatable-page-master has a region-name
associated to any flow in an fo:page-sequence, then the
sub-sequence is constrained to have length zero.<spot id="od000280_5"/></p>

<p><emph>Contents:</emph></p>
<eg xml:space="preserve">
EMPTY
</eg>

<p><emph>The following properties apply to this formatting object:</emph></p><slist>
<sitem><specref ref="master-reference"/></sitem>
<sitem><specref ref="maximum-repeats"/></sitem>
</slist>
</div3>


<div3 id="fo_repeatable-page-master-alternatives"><head>fo:repeatable-page-master-alternatives</head>

<p><emph>Common Usage:</emph></p>
<p>The fo:repeatable-page-master-alternatives
formatting object is the most complex
sub-sequence-specifier.  It
specifies a sub-sequence consisting of repeated instances of a set of
alternative page-masters. The number of repetitions may be bounded or
potentially unbounded. Which of the alternative page-masters is used
at any point in the sequence depends on the evaluation of a condition
on the use of the alternative. Typical conditions include, testing
whether the page which is generated using the alternative is the first
or last page in a page-sequence or is the page blank. The full set of
conditions allows different page-masters to be used for the first
page, for odd and even pages, for blank pages.</p>
<note>
<p>Because the conditions are tested in order from the
beginning of the sequence of children, the last alternative in the
sequence usually has a condition that is always true and this
alternative references the page-master that is used for all pages that
do not receive some specialized layout.
</p>
</note>

<p><emph>Areas:</emph></p>
<p>The fo:repeatable-page-master-alternatives
formatting object generates no area directly.  This formatting object
is used by the fo:page-sequence formatting object to generate pages.
</p>

<p><emph>Constraints:</emph></p>
<p>The children of the fo:repeatable-page-master-alternatives are
fo:conditional-page-master-references. These children will be called
<term>alternatives</term>.
</p>
<p>The sub-sequence of pages mapped to this
sub-sequence-specifier satisfies
the constraints of this sub-sequence-specifier if (a) the
sub-sequence of pages <spot id="jm010109_44"/>consists of zero or more pages, (b) each page is
generated using the fo:simple-page-master
referenced by the one of the alternatives that
are the children of the fo:repeatable-page-master-alternatives, (c)
the conditions on that alternative are <code role="value">true</code>, (d) that
alternative is the first alternative in the sequence of children for
which all the conditions are <code role="value">true</code>, and (e) the length
of the sub-sequence is less than or equal to the value of
<trait>maximum-repeats</trait>.<spot id="aj000035_26"/>
</p>

<p><emph>Contents:</emph></p>
<eg xml:space="preserve">
(<loc href="#fo_conditional-page-master-reference" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">conditional-page-master-reference</loc>+)
</eg>

<p><emph>The following properties apply to this formatting object:</emph></p><slist>
<sitem><specref ref="maximum-repeats"/></sitem>
</slist>
</div3>


<div3 id="fo_conditional-page-master-reference"><head>fo:conditional-page-master-reference</head>

<p><emph>Common Usage:</emph></p>
<p>The fo:conditional-page-master-reference is used to identify a
page-master that is to be used when the conditions on its use are
satisfied. This allows different page-masters to be used, for example,
for even and odd pages, for the first page in a page-sequence, or for
blank pages. This usage is typical in chapters of a book or report
where the first page has a different layout than the rest of the
chapter and the headings and footings on even and odd pages
may be different as well.
</p>

<p><emph>Areas:</emph></p>
<p>The fo:conditional-page-master-reference formatting object generates no area directly.
It is used by
the fo:page-sequence formatting object to generate pages.
</p>

<p><emph>Constraints:</emph></p>
<p>The fo:conditional-page-master-reference has a reference to the
fo:simple-page-master which has the same master-name as
the <trait>master-reference</trait> trait on the fo:conditional-page-master-reference.
</p>
<p>There are three traits, <trait>page-position</trait>,
<trait>odd-or-even</trait>, and <trait>blank-or-not-blank</trait> that
specify the
sub-conditions on the use of the referenced page-master. All three
sub-conditions must be <code role="value">true</code> for the condition on the
fo:conditional-page-master-reference to be <code role="value">true</code>. <spot id="c11i48"/>Since
the properties from which these traits are derived are not inherited and
the initial value of all the
properties makes the corresponding sub-condition <code role="value">true</code>, this
really means that the subset of traits that are derived from properties
with specified values must make the corresponding
sub-condition <code role="value">true</code>.
</p>
<p>The sub-condition corresponding to the <trait>page-position</trait>
trait is <code role="value">true</code> <spot id="c11i49_a"/>if the page generated using the
fo:conditional-page-master-reference has the specified position in the
sequence of pages generated by the referencing page-sequence; namely,
"first", "last", "rest" (not first
nor last) or
"any" (all of the previous). The <term>referencing
page-sequence</term> is the fo:page-sequence that referenced the
fo:page-sequence-master from which this
fo:conditional-page-master-reference is a descendant.
</p>
<p>The sub-condition corresponding to the <trait>odd-or-even</trait>
trait is <code role="value">true</code> <spot id="c11i49_b"/>if the value of the <trait>odd-or-even</trait>
trait is "any" or if the value matches the parity of the
page number of the page generated using the
fo:conditional-page-master-reference.
</p>
<p>The sub-condition corresponding to the <trait>blank-or-not-blank</trait> trait is
<code role="value">true</code>, <spot id="c11i50_a"/>if (1) the value of the trait is
"not-blank" and the page generated using the
fo:conditional-page-master-reference has areas generated by descendants of
the fo:flow formatting object; <spot id="c11i50_b"/>if (2) the value of the trait is
"blank" and the page generated using the
fo:conditional-page-master-reference is such that there are
no areas from the fo:flow to be put on that page (e.g.,
(a) to maintain proper page parity due to (i) a break-after
or break-before value of "even-page" or "odd-page" or (ii) at the
start or end of the page-sequence or (b) because the
constraints
on the areas generated by descendants of the fo:flow formatting object would
not be satisfied if they were descendant from this page); or <spot id="c11i50_c"/>if (3)
the value of the trait is "any".
</p>
<note>
<p>If any page-master referenced from a conditional-page-master-reference
with blank-or-not-blank="<code role="value">true</code>" provides a region
in which to put fo:flow content, no content is put in that
region.<spot id="od000280_6"/></p>
</note>

<p><emph>Contents:</emph></p>
<eg xml:space="preserve">
EMPTY
</eg>

<p><emph>The following properties apply to this formatting object:</emph></p><slist>
<sitem><specref ref="master-reference"/></sitem>
<sitem><specref ref="page-position"/></sitem>
<sitem><specref ref="odd-or-even"/></sitem>
<sitem><specref ref="blank-or-not-blank"/></sitem>
</slist>
</div3>


<div3 id="fo_simple-page-master"><head>fo:simple-page-master</head>

<p><emph>Common Usage:</emph></p>
<p>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: region-body, region-before, region-after,
region-start, and region-end.</p>
<note>
<p>For example, if the <trait>writing-mode</trait> of the
fo:simple-page-master is "lr-tb", then these regions
correspond to the body of a document, the header, the footer, the
left sidebar, and the right sidebar.</p>
</note>
<note>
<p>The simple-page-master is intended for systems that wish to provide
a simple page layout facility. Future versions of this <spot id="jm010109_10f"/>Recommendation
will support more complex page layouts constructed using the
fo:page-master formatting object.</p>
</note>

<p><emph>Areas:</emph></p>
<p>The fo:simple-page-master formatting object generates no area directly.
It is used in the generation of pages by an
fo:page-sequence.
</p>
<p>
When the fo:simple-page-master is used to generate a page, a viewport/reference
pair is generated, consisting 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.
</p>
<p>In addition, when the fo:simple-page-master is used to generate a
page, viewport/reference pairs that correspond to the regions that are the
children of the fo:simple-page-master are also generated.
(See the formatting object specifications for
the five regions (<spot id="c11i1_g"/><specref ref="fo_region-body"/>,
<specref ref="fo_region-before"/>,
<specref ref="fo_region-after"/>,
<specref ref="fo_region-start"/>, and
<specref ref="fo_region-end"/>)
for the details on the generation of these areas.)
</p>
<figure>
<graphic source="ViewportsToPage-level.gif" alt="Region-viewport-areas" longdesc="Representation of a page, showing the five regions: region-before (top), region-after (bottom), region-start (left) and region-end (right) and region-body (center)." xml:attributes="href source" show="embed" actuate="auto" xmlns:xlink="http://www.w3.org/TR/WD-xlink"/>
<figcap><p><spot id="aj000029_51"/>Region-viewport-areas</p>
<p>The spacing between the outer four regions and the fo:region-body is determined
by subtracting the relevant <trait>extent</trait> trait on each outer region
from the "margin-x" property on the fo:region-body.</p>
</figcap>
</figure>

<p><emph>Trait Derivation:</emph></p>
<p>In version 1.0 of this <spot id="jm010109_10g"/>Recommendation, borders and padding are not
allowed with a page-reference-area.  The remaining traits on the
page-reference-area are
set according to normal rules for determining the values of
traits.</p>

<p><emph>Constraints:</emph></p>
<p>When a page-master is used in the generation of a page, the
<trait>block-progression-dimension</trait> and <trait>inline-progression-dimension</trait> of the
content-rectangle of the page-viewport-area are determined using the
computed values of the
"page-height" and "page-width" properties.</p>
<p>The traits derived from the margin properties determine the size
and position of the content-rectangle of the page-viewport-area.
The traits derived from the "margin-top",
"margin-bottom", "margin-left" and
"margin-right" properties are used to indent the page-reference-area
content-rectangle from the corresponding edge of the content-rectangle of the
page-viewport-area. Here "top", "bottom", "left"
and "right" are determined by the computed values of the
"page-height" and "page-width" properties. For
sheet media, these values determine the orientation of the sheet;
"page-height" is measured from "top" to
"bottom". <spot id="c11i53"/>For display media, the display window is always
upright; the top of the display screen is "top".
</p>
<note>
<p>
The reference points for the page-viewport-area content-rectangle
are in terms of the "top", "bottom",
"left", and "right" rather than
"before-edge", "after-edge",
"start-edge", and "end-edge" because users see the
media relative to its orientation and not relative to the
<trait>writing-mode</trait> currently in use.
</p>
</note>
<graphic source="MediaReferenceArea.gif" alt="Margins of a page" longdesc="A page rectangle showing the margins on each side. The outer rectangle is the content-rectangle of the page-viewport-area and the inner rectangle is the content-rectangle of the page-reference-area." xml:attributes="href source" show="embed" actuate="auto" xmlns:xlink="http://www.w3.org/TR/WD-xlink"/>
<p>The value of the <trait>page-number</trait> trait on the
first page returned by the
fo:page-sequence is constrained to equal the value of the
<trait>initial-page-number</trait> trait. The value of the
<trait>page-number</trait>
trait on subsequent pages is constrained to be one greater than the
value on the immediately preceding page.
</p>

<p>The <trait>format</trait>, <trait>letter-value</trait>,
<trait>grouping-separator</trait>, <trait>grouping-size</trait>,
<trait>country</trait>, and
<trait>language</trait> traits are used to format the number into a
string form, as specified in XSLT, section 7.7.1. This formatted
number is used as the value of the fo:page-number flow object.

</p>

<p><emph>Constraints applicable to regions:</emph></p>
<p>There are a number of constraints that apply to all the
regions that are specified within a given fo:simple-page-master.
</p>

<graphic source="PageAndRegion-bodyWithOrientationOnPage.gif" alt="Two page model examples" longdesc="Two examples of page models. In the first the reference orientations of the media and the page-master are 0. In the second the reference orientation of the page-master is 90. In each case, the margins are labelled with the corresponding relative names." xml:attributes="href source" show="embed" actuate="auto" xmlns:xlink="http://www.w3.org/TR/WD-xlink"/>
<p>
If the block-progression-dimension of the properly stacked
region-reference-area is greater than the block-progression-dimension of the
region-viewport-area that is its parent, then the constraints on
the relationship between the region-viewport-area and the
region-reference-area depend on values of the <trait>overflow</trait> trait
on the region-master and the kind of flow
assigned to the region.

</p>
<p>If the flow assigned to the corresponding region is an
fo:static-content flow object, then there is no constraint
on the block-progression-dimension of the region-reference-area.</p>

<p>If the flow assigned to the corresponding region is an fo:flow formatting
object, then</p>
<ulist>
<item><p>If the value of the <trait>media-usage</trait> trait is
<code>paginate</code>,
or the value of the <trait>overflow</trait> trait is
<code>visible</code>, <code>hidden</code>, or <code>error-if-overflow</code>,
then the block-progression-dimension of the region-reference-area is
constrained to be no greater than the block-progression-dimension of
the region-viewport-area.</p>
</item>
<item><p>If the value of the <trait>media-usage</trait> trait is
<code>bounded-in-one-dimension</code> or <code>unbounded</code>,
and the value of the <trait>overflow</trait> trait is
<code>scroll</code> or <code>auto</code>,
then there is no constraint on the
block-progression-dimension of the region-reference-area.</p>
</item>
</ulist>


<p><emph>Contents:</emph></p>
<eg xml:space="preserve">
(<loc href="#fo_region-body" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">region-body</loc>,<loc href="#fo_region-before" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">region-before</loc>?,<loc href="#fo_region-after" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">region-after</loc>?,<loc href="#fo_region-start" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">region-start</loc>?,<loc href="#fo_region-end" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">region-end</loc>?)
</eg>

<p><emph>The following properties apply to this formatting object:</emph></p><slist>
<sitem><specref ref="common-margin-properties-block"/></sitem>
<sitem><specref ref="master-name"/></sitem>
<sitem><specref ref="page-height"/></sitem>
<sitem><specref ref="page-width"/></sitem>
<sitem><specref ref="reference-orientation"/></sitem>

<sitem><specref ref="writing-mode"/></sitem>
</slist>
</div3>


<div3 id="fo_region-body"><head>fo:region-body</head>

<p><emph>Common Usage:</emph></p>
<p>Used in constructing a simple-page-master. This region specifies a
viewport/reference pair that is located in the "center" of the
fo:simple-page-master. The <trait>overflow</trait> trait controls how
much of the underlying region-reference-area is visible; that is, whether
the region-reference-area is clipped by <spot id="c11i55_a"/>its parent region-viewport-area.
</p>
<note>
<p>Typically, for paged media, the areas
returned by the fo:flow formatting object in a
fo:page-sequence are made to be
descendants of a sequence of region-reference-areas that
correspond to
the region-body. These region-reference-areas are all area descendants
of page-areas for which the page-master included an fo:region-body. If
the fo:flow flow is assigned to some other region, then the areas
returned by the fo:flow are constrained to be descendants of
region-reference-areas generated using the assigned region-master.
</p>
</note>
<note><p>The body region should be sized and positioned within the
fo:simple-page-master so that there is room
for the areas returned by the flow that is assigned to the
fo:region-body and for any desired side regions, that is,
fo:region-before, fo:region-after, fo:region-start and fo:region-end's
that are to be placed on the same page. These side regions are
positioned within the content-rectangle of the page-reference-area. The
margins on the fo:region-body are used to position the region-viewport-area
for the fo:region-body and to leave space for the other regions that
surround the fo:region-body.
</p>

<graphic source="PageAndRegion-bodyMargins.gif" alt="A close-up of the first case in the previous figure." longdesc="figure showing the margins of a page and the margins of that page's region-body" xml:attributes="href source" show="embed" actuate="auto" xmlns:xlink="http://www.w3.org/TR/WD-xlink"/>
<p>
The spacing between the last four regions and the fo:region-body is
determined by subtracting the relevant <trait>extent</trait> trait on
the side regions from the trait that corresponds to the
"margin-<var>x</var>" property on the fo:region-body.</p>
</note>
<p>The fo:region-body may be also be used to provide multiple
columns. When the <trait>column-count</trait> trait is greater than one, then
the region-body will be subdivided into multiple columns.
</p>

<p><emph>Areas:</emph></p>
<p>The fo:region-body formatting object is used to generate one
region-viewport-area and one region-reference-area whenever an
fo:simple-page-master that has an fo:region-body as a child
is used to
generate a page.
A scrolling mechanism shall be provided, in an implementation-defined
manner, if the value of the
<trait>overflow</trait> trait is "scroll".
</p>
<p>
The position and size of the region-viewport-area is
specified relative to the content-rectangle of the
page-reference-area generated by fo:simple-page-master. The content-rectangle
of the region-viewport-area is indented from the content-rectangle
of the page-reference-area by the values of the "margin-top",
"margin-bottom", "margin-left" and "margin-right" properties.
In version 1.0 of this <spot id="jm010109_10h"/>Recommendation, the values of the <trait>padding</trait>
and <trait>border-width</trait> traits must be "0".
</p>
<p>
The region-reference-area generated using an fo:region-body is the child
of the region-viewport-area. The <trait>reference-orientation</trait> trait
of the fo:region-body is used to orient the coordinate system of the
region-reference-area generated by the fo:region-body relative to the
coordinate system of the page-reference-area generated by
fo:simple-page-master (and, therefore, relative to the viewport
positioned in that latter coordinate system).
</p>
<p>In addition to the viewport/reference pair, when the
region-body is used to
generate areas,
at least one and up to three additional reference-areas are
generated. These reference-areas are the optional
<term>before-float-reference-area</term>,
the optional <term>footnote-reference-area</term>, and the
<term>main-reference-area</term>. The latter reference-area comprises
the space left after space is borrowed for the other two
reference-areas. The main-reference-area has no
padding, border, or space associated with it.
</p>
<note>
<p>If there is no before-float-reference-area or footnote-reference-area
child of the region-reference-area, then the content-rectangle of the
main-reference-area is coterminous with the content-rectangle
of the region-reference-area.</p>
</note>

<p><spot id="fosg_2c"/>The main-reference-area has as its children
a sequence of <term>span-reference-areas</term>.
These are reference-area block-areas with zero border and padding,
whose inline-progression-dimension is
equal to that of the main-reference-area,
and which are normally stacked within the main-reference-area.</p>
<p>Each span-reference-area has one or more reference-area children,
designated as <term>normal-flow-reference-areas</term>.
The number and placement of the children of a span-reference-area
depends on the <trait>column-count</trait> trait of the span-reference-area.
In turn, the formatter must generate precisely enough of these
span-reference-areas, and so set their <trait>column-count</trait> traits,
that block-areas
returned from the fo:flow with a <trait>span</trait> of "all" are children of
span-reference-areas with <trait>column-count</trait> equal to 1,
and block-areas returned from the fo:flow with a <trait>span</trait> of "none"
are children of span-reference-areas with <trait>column-count</trait> equal to
the refined value of the column-count property of the
associated region-reference-area.</p>
<p>For each span-reference-area, the number <var>N</var>
of normal-flow-reference-area children is equal to the value of the
<trait>column-count</trait> trait.</p>
<p>It is an error to specify a <trait>column-count</trait> other
than 1 if the "overflow" property has the value "scroll".
An implementation may recover by behaving as if "1" had been specified.</p>
<p>The inline-progression-dimension of each of these
normal-flow-reference-areas is determined by subtracting
(<var>N</var>-1) times the column-gap trait from the
inline-progression-dimension of the
main-reference-area and dividing that result by <var>N</var>.
Using "body-in-size" for the name of the inline-progression-dimension
of the span-reference-area and "column-in-size" for the name of the size
of the normal-flow-reference-areas in the inline-progression-direction,
the formula is:</p>
<p>column-in-size = (body-in-size - (<var>N</var> - 1)*column-gap)/<var>N</var></p>
<p>The block-progression-dimension of the normal-flow-reference-areas
is the same as that of the parent span-reference-area.</p>
<note><p>As noted above, the block-progression-dimension of the
span-reference-area may be less than the size of the
region-reference-area if a before-float-reference-area or
footnote-reference-area are present, or if there is more than one
span-reference-area child of the main-reference-area.</p>
</note>
<p>The normal-flow-reference-areas are positioned within the
span-reference-area as follows: The first column is positioned
with the before-edge and start-edge of its content-rectangle
coincident with the before-edge and start-edge of the content-rectangle
of the span-reference-area. The content-rectangle of the <var>J</var>th
normal-flow-reference-area child of the span-reference-area
is positioned with its before-edge coincident with the before-edge
of the content-rectangle of the span-reference-area and with is
start-edge at ((<var>J</var>-1)*(column-in-size + column-gap))
in the inline-progression-direction.
This results in the end-edge of the content-rectangle of the
<var>N</var>th normal-flow-reference-area being coincident with
the end-edge of the content-rectangle of the span-reference-area.</p>

<note>
<p>If the <trait>writing-mode</trait> is "rl-tb", the
above description means that the columns are ordered from right-to-left
as would be expected. This follows because the start-edge is on
the right in an "rl-tb" <spot id="c11i57"/>writing-mode.</p>
</note>
<p>All areas generated by using the fo:region-body are of area-class "xsl-absolute".</p>

<p><emph>Trait Derivation:</emph></p>
<p>
The <trait>reference-orientation</trait> of the region-viewport-area
is taken from the value <spot id="c11i58_a"/>of the
<trait>reference-orientation</trait> trait on the region-master which
specifies the region. <trait>reference-orientation</trait> of the
region-reference-area is set to "0" and is, therefore, the
same as the orientation established by the region-viewport-area.
</p>
<p>The remaining traits on the
region-viewport-area and region-reference-area are
set according to normal rules for determining the values of
traits.</p>
<p>The traits on the span-reference-areas and on the
normal-flow-reference-areas are determined,
in the same manner as described in <specref ref="refinement"/>,
from a set of properties where each property has its initial
value except for
reference-orientation,
writing-mode, and
display-align
that have the value from the fo:region-body.</p>

<p><emph>Constraints:</emph></p>
<p>The constraints applicable to all regions (see
<specref ref="fo_simple-page-master"/>) all apply.
</p>
<p>
The inline-progression-dimension of the region-viewport-area is
determined by the inline-progression-dimension of the
content-rectangle of the page-reference-area minus the values
of the <trait>start-indent</trait> and <trait>end-indent</trait>
traits of the region-master. The start-edge and end-edge of the
content-rectangle of the region-viewport-area are determined by the
<trait>reference-orientation</trait> trait on the page-master.
</p>
<p>
The block-progression-dimension of the region-viewport-area is
determined by the block-progression-dimension of the content-rectangle
for the page-reference-area minus the values of the
<trait>space-before</trait> and <trait>space-after</trait> traits of
the region-master. The before-edge and after-edge of the content-rectangle
of the region-viewport-area
are determined by the <trait>reference-orientation</trait> trait on
the page-master.
</p>
<p>
The values of the <trait>space-before</trait> and
<trait>start-indent</trait> traits are used to position the
region-viewport-area relative to the before-edge and
start-edge of the content-rectangle of
the page-reference-area.
</p>
<p>
The constraints on the size and position of the region-reference-area
generated using the fo:region-body are covered in the "Constraints
applicable to regions" section of <specref ref="fo_simple-page-master"/>.</p>


<p><emph>Contents:</emph></p>
<eg xml:space="preserve">
EMPTY
</eg>

<p><emph>The following properties apply to this formatting object:</emph></p><slist>
<sitem><specref ref="common-border-padding-and-background-properties"/></sitem>
<sitem><specref ref="common-margin-properties-block"/></sitem>
<sitem><specref ref="clip"/></sitem>
<sitem><specref ref="column-count"/></sitem>
<sitem><specref ref="column-gap"/></sitem>
<sitem><specref ref="display-align"/></sitem>
<sitem><specref ref="overflow"/></sitem>
<sitem><specref ref="region-name"/></sitem>
<sitem><specref ref="reference-orientation"/></sitem>
<sitem><specref ref="writing-mode"/></sitem>
</slist>
</div3>


<div3 id="fo_region-before"><head>fo:region-before</head>

<p><emph>Common Usage:</emph></p>
<p>Used in constructing a simple-page-master. This region specifies
a viewport/reference pair that is located on the "before" side of
the page-reference-area.
In lr-tb writing-mode, this region corresponds to
the header
region. The <trait>overflow</trait> trait controls how
much of the underlying region-reference-area is visible; that is, whether
the region-reference-area is clipped by <spot id="c11i55_b"/>its parent region-viewport-area.</p>

<p><emph>Areas:</emph></p>
<p>The fo:region-before formatting object is used to generate one
region-viewport-area
and one region-reference-area.
</p>
<p><spot id="fosg_00a"/>In version 1.0 of this <spot id="jm010109_10i"/>Recommendation,
the values of the <trait>padding</trait>
and <trait>border-width</trait> traits must be "0".
</p>
<p>
The before-edge of the content-rectangle of this
region-viewport-area is positioned coincident with the
before-edge of the content-rectangle of the page-reference-area
generated using the parent fo:simple-page-master.  The block-progression-dimension
of the region-viewport-area is
determined by the <trait>extent</trait> trait on the fo:region-before
formatting object.</p>

<p>The inline-progression-dimension of the region-viewport-area is determined by the
<trait>precedence</trait> trait on the fo:region-before.  If the value
of the <trait>precedence</trait> trait is <code role="value">true</code>, then the
inline-progression-dimension extends up to the start-edge and
<spot id="aj010000_1a"/>end-edge of the
content-rectangle of the page-reference-area. In this case, the region-before
region-viewport-area acts like a float into areas
generated by the region-start and region-end. If the
value of the <trait>precedence</trait> trait on the fo:region-before
is <code role="value">false</code>, then these adjacent regions float into the area
generated by the fo:region-before and the extent of the
fo:region-before is (effectively) reduced by the incursions of the
adjacent regions.
</p>
<p>
The region-reference-area lies on a canvas
underneath the region-viewport-area. The
<trait>reference-orientation</trait> trait is used to orient the
coordinate system of the region-reference-area relative to the
page-reference-area.
</p>
<p>
The size of the region-reference-area depends on the setting of the
<trait>overflow</trait> trait on the region. If the value of that
trait
is "auto", "hidden", "error-if-overflow", "paginate",
or "visible" then the size of the
reference-area
is the same as the size of the viewport. If the value of the
<trait>overflow</trait>
trait is "scroll", the size of the reference-area is
equal
to the size of the viewport in the
inline-progression-direction in the
<trait>writing-mode</trait> for the region and has no constraint in the
block-progression-direction (which implies that it grows to
<spot id="c11i59_a"/>hold the distribution of all the content bound to the region).</p>

<p><emph>Trait Derivation:</emph></p>
<p>
The <trait>reference-orientation</trait> of the region-viewport-area
is taken from the value <spot id="c11i58_b"/>of the
<trait>reference-orientation</trait> trait on the region-master which
specifies the region. <trait>reference-orientation</trait> of the
region-reference-area is set to "0" and is, therefore, the
same as the orientation established by the region-viewport-area.
</p>
<p>The remaining traits on the
region-viewport-area and region-reference-area are
set according to normal rules for determining the values of
traits.</p>

<p><emph>Constraints:</emph></p>
<p>
The constraints on the size and position of the region-reference-area
generated using the fo:region-before are covered in the "Constraints
applicable to regions" section of <specref ref="fo_simple-page-master"/>.</p>

<p><emph>Contents:</emph></p>
<eg xml:space="preserve">
EMPTY
</eg>

<p><emph>The following properties apply to this formatting object:</emph></p><slist>
<sitem><specref ref="common-border-padding-and-background-properties"/></sitem>
<sitem><specref ref="clip"/></sitem>
<sitem><specref ref="display-align"/></sitem>
<sitem><specref ref="extent"/></sitem>
<sitem><specref ref="overflow"/></sitem>
<sitem><specref ref="precedence"/></sitem>
<sitem><specref ref="region-name"/></sitem>
<sitem><specref ref="reference-orientation"/></sitem>
<sitem><specref ref="writing-mode"/></sitem>
</slist>
</div3>


<div3 id="fo_region-after"><head>fo:region-after</head>

<p><emph>Common Usage:</emph></p>
<p>Used in constructing a simple-page-master. This region specifies
a viewport/reference pair that is located on the "after" side of
the page-reference-area.
In lr-tb writing-mode, this region corresponds to
the footer
region. The <trait>overflow</trait> trait controls how
much of the underlying region-reference-area is visible; that is, whether
the region-reference-area is clipped by <spot id="c11i55_c"/>its parent region-viewport-area.
</p>

<p><emph>Areas:</emph></p>
<p>The fo:region-after formatting object is used to generate one
region-viewport-area
and one region-reference-area.
</p>
<p><spot id="fosg_00b"/>In version 1.0 of this <spot id="jm010109_10j"/>Recommendation,
the values of the <trait>padding</trait>
and <trait>border-width</trait> traits must be "0".
</p>
<p>
The after-edge of the content-rectangle of this
region-viewport-area is positioned coincident with the
after-edge of the content-rectangle of the page-reference-area
generated using the parent fo:simple-page-master.  The block-progression-dimension
of the region-viewport-area is
determined by the <trait>extent</trait> trait on the fo:region-after
formatting object.</p>
<p>The inline-progression-dimension of the region-viewport-area is determined by the
<trait>precedence</trait> trait on the fo:region-after.  If the value
of the <trait>precedence</trait> trait is <code role="value">true</code>, then the
inline-progression-dimension extends up to the start-edge and
<spot id="aj010000_1b"/>end-edge of the
content-rectangle of the page-reference-area. In this case, the region-after
region-viewport-area acts like a float into areas
generated by the region-start and region-end. If the
value of the <trait>precedence</trait> trait on the fo:region-after
is <code role="value">false</code>, then these adjacent regions float into the area
generated by the fo:region-after and the extent of the
fo:region-after is (effectively) reduced by the incursions of the
adjacent regions.
</p>
<p>
The region-reference-area lies on a canvas
underneath the region-viewport-area. The
<trait>reference-orientation</trait> trait is used to orient the
coordinate system of the region-reference-area relative to the
page-reference-area.
</p>
<p>The size of the region-reference-area depends on the setting of the
<trait>overflow</trait> trait on the region. If the value of that
trait
is "auto", "hidden", "error-if-overflow", "paginate",
or "visible" then the size of the
reference-area
is the same as the size of the viewport. If the value of the
<trait>overflow</trait>
trait is "scroll", the size of the reference-area is
equal
to the size of the viewport in the
inline-progression-direction in the
<trait>writing-mode</trait> for the region and has no constraint in
block-progression-direction (which implies that it grows to
<spot id="c11i59_b"/>hold the distribution of all the content bound to the region).</p>

<p><emph>Trait Derivation:</emph></p>
<p>
The <trait>reference-orientation</trait> of the region-viewport-area
is taken from the value <spot id="c11i58_c"/>of the
<trait>reference-orientation</trait> trait on the region-master which
specifies the region. <trait>reference-orientation</trait> of the
region-reference-area is set to "0" and is, therefore, the
same as the orientation established by the region-viewport-area.
</p>
<p>The remaining traits on the
region-viewport-area and region-reference-area are
set according to normal rules for determining the values of
traits.</p>

<p><emph>Constraints:</emph></p>
<p>
The constraints on the size and position of the region-reference-area
generated using the fo:region-after are covered in the "Constraints
applicable to regions" section of <specref ref="fo_simple-page-master"/>.</p>

<p><emph>Contents:</emph></p>
<eg xml:space="preserve">
EMPTY
</eg>

<p><emph>The following properties apply to this formatting object:</emph></p><slist>
<sitem><specref ref="common-border-padding-and-background-properties"/></sitem>
<sitem><specref ref="clip"/></sitem>
<sitem><specref ref="display-align"/></sitem>
<sitem><specref ref="extent"/></sitem>
<sitem><specref ref="overflow"/></sitem>
<sitem><specref ref="precedence"/></sitem>
<sitem><specref ref="region-name"/></sitem>
<sitem><specref ref="reference-orientation"/></sitem>
<sitem><specref ref="writing-mode"/></sitem>
</slist>
</div3>


<div3 id="fo_region-start"><head>fo:region-start</head>

<p><emph>Common Usage:</emph></p>
<p>Used in constructing a simple-page-master. This region specifies
a viewport/reference pair that is located on the "start" side of
the page-reference-area.
In lr-tb writing-mode, this region corresponds to a left
sidebar. The <trait>overflow</trait> trait controls how
much of the underlying region-reference-area is visible; that is, whether
the region-reference-area is clipped by <spot id="c11i55_d"/>its parent region-viewport-area.</p>

<p><emph>Areas:</emph></p>
<p>The fo:region-start formatting object is used to generate one
region-viewport-area
and one region-reference-area.
</p>
<p><spot id="fosg_00c"/>In version 1.0 of this <spot id="jm010109_10k"/>Recommendation,
the values of the <trait>padding</trait>
and <trait>border-width</trait> traits must be "0".
</p>
<p>
The start-edge of the content-rectangle of this
region-viewport-area is positioned coincident with the
start-edge of the content-rectangle of the page-reference-area
generated using the parent fo:simple-page-master.  The inline-progression-dimension
of the region-viewport-area is
determined by the <trait>extent</trait> trait on the fo:region-after
formatting object.</p>
<p>The block-progression-dimension of the region-viewport-area is
determined by the <trait>precedence</trait> trait on the
adjacent fo:region-before and the fo:region-after, if these exist;
otherwise it is determined as if the value of the <trait>precedence</trait>
trait was <code role="value">false</code>.
If the value of the
<trait>precedence</trait> trait of the fo:region-before (or, respectively,
fo:region-after) is <code role="value">false</code>, then the
block-progression-dimension
extends up to the before- (or, respectively, after-) edge of the
content-rectangle of the page-reference-area. In this case, the
region-start acts like a float into areas
generated by the region-before (respectively, the region-after). If
the value of the <trait>precedence</trait> trait on the adjacent regions is
<code role="value">true</code>, then these adjacent regions float into
the area generated by
the fo:region-start and the extent of the fo:region-start is
(effectively) reduced by the incursions of the adjacent regions with
the value of the <trait>precedence</trait> trait equal to <code role="value">true</code>.</p>
<p>The region-reference-area lies on a canvas
underneath the region-viewport-area. The
<trait>reference-orientation</trait> trait is used to orient the
coordinate system of the region-reference-area relative to the
page-reference-area.
</p>
<p>The size of the region-reference-area depends on the setting of the
<trait>overflow</trait> trait on the region. If the value of that
trait
is "auto", "hidden", "error-if-overflow", "paginate",
or "visible" then the size of the
reference-area
is the same as the size of the viewport. If the value of the
<trait>overflow</trait>
trait is "scroll", the size of the reference-area is
equal
to the size of the viewport in the
inline-progression-direction in the
<trait>writing-mode</trait> for the region and has no constraint in
block-progression-direction (which implies that it grows to
<spot id="c11i59_c"/>hold the distribution of all the content bound to the region).</p>

<p><emph>Trait Derivation:</emph></p>
<p>
The <trait>reference-orientation</trait> of the region-viewport-area
is taken from the value <spot id="c11i58_d"/>of the
<trait>reference-orientation</trait> trait on the region-master which
specifies the region. <trait>reference-orientation</trait> of the
region-reference-area is set to "0" and is, therefore, the
same as the orientation established by the region-viewport-area.
</p>
<p>The remaining traits on the
region-viewport-area and region-reference-area are
set according to normal rules for determining the values of
traits.</p>

<p><emph>Constraints:</emph></p>
<p>
The constraints on the size and position of the region-reference-area
generated using the fo:region-start are covered in the "Constraints
applicable to regions" section of <specref ref="fo_simple-page-master"/>.</p>

<p><emph>Contents:</emph></p>
<eg xml:space="preserve">
EMPTY
</eg>

<p><emph>The following properties apply to this formatting object:</emph></p><slist>
<sitem><specref ref="common-border-padding-and-background-properties"/></sitem>
<sitem><specref ref="clip"/></sitem>
<sitem><specref ref="display-align"/></sitem>
<sitem><specref ref="extent"/></sitem>
<sitem><specref ref="overflow"/></sitem>
<sitem><specref ref="region-name"/></sitem>
<sitem><specref ref="reference-orientation"/></sitem>
<sitem><specref ref="writing-mode"/></sitem>
</slist>
</div3>


<div3 id="fo_region-end"><head>fo:region-end</head>

<p><emph>Common Usage:</emph></p>
<p>Used in constructing a simple-page-master. This region specifies
a viewport/reference pair that is located on the "end" side of
the page-reference-area.
In lr-tb writing-mode, this region corresponds to a right sidebar.
The <trait>overflow</trait> trait controls how
much of the underlying region-reference-area is visible; that is, whether
the region-reference-area is clipped by <spot id="c11i55_e"/>its parent region-viewport-area.</p>

<p><emph>Areas:</emph></p>
<p>The fo:region-end formatting object is used to generate one
region-viewport-area
and one region-reference-area.
</p>
<p><spot id="fosg_00d"/>In version 1.0 of this <spot id="jm010109_10l"/>Recommendation,
the values of the <trait>padding</trait>
and <trait>border-width</trait> traits must be "0".
</p>
<p>
The end-edge of the content-rectangle of this
region-viewport-area is positioned coincident with the
end-edge of the content-rectangle of the page-reference-area
generated using the parent fo:simple-page-master.  The inline-progression-dimension
of the region-viewport-area is
determined by the <trait>extent</trait> trait on the fo:region-after
formatting object.</p>
<p>The block-progression-dimension of the region-viewport-area is
determined by the <trait>precedence</trait> trait on the
adjacent fo:region-before and the fo:region-after, if these exist;
otherwise it is determined as if the value of the <trait>precedence</trait>
trait was <code role="value">false</code>.
If the value of the
<trait>precedence</trait> trait of the fo:region-before (or, respectively,
fo:region-after) is <code role="value">false</code>, then the
block-progression-dimension
extends up to the before- (or, respectively, after-) edge of the
content-rectangle of the page-reference-area. In this case, the
region-end acts like a float into areas
generated by the region-before (respectively, the region-after). If
the value of the <trait>precedence</trait> trait on the adjacent regions is
<code role="value">true</code>, then these adjacent regions float into
the area generated by
the fo:region-end and the extent of the fo:region-end is
(effectively) reduced by the incursions of the adjacent regions with
the value of the <trait>precedence</trait> trait equal to <code role="value">true</code>.</p>
<p>The region-reference-area lies on a canvas
underneath the region-viewport-area. The
<trait>reference-orientation</trait> trait is used to orient the
coordinate system of the region-reference-area relative to the
page-reference-area.
</p>
<p>The size of the region-reference-area depends on the setting of the
<trait>overflow</trait> trait on the region. If the value of that
trait
is "auto", "hidden", "error-if-overflow", "paginate",
or "visible" then the size of the
reference-area
is the same as the size of the viewport. If the value of the
<trait>overflow</trait>
trait is "scroll", the size of the reference-area is
equal
to the size of the viewport in the
inline-progression-direction in the
<trait>writing-mode</trait> for the region and has no constraint in
block-progression-direction (which implies that it grows to
<spot id="c11i59_d"/>hold the distribution of all the content bound to the region).</p>

<p><emph>Trait Derivation:</emph></p>
<p>
The <trait>reference-orientation</trait> of the region-viewport-area
is taken from the value <spot id="c11i58_e"/>of the
<trait>reference-orientation</trait> trait on the region-master which
specifies the region. <trait>reference-orientation</trait> of the
region-reference-area is set to "0" and is, therefore, the
same as the orientation established by the region-viewport-area.
</p>
<p>The remaining traits on the
region-viewport-area and region-reference-area are
set according to normal rules for determining the values of
traits.</p>

<p><emph>Constraints:</emph></p>
<p>
The constraints on the size and position of the region-reference-area
generated using the fo:region-end are covered in the "Constraints
applicable to regions" section of <specref ref="fo_simple-page-master"/>.</p>

<p><emph>Contents:</emph></p>
<eg xml:space="preserve">
EMPTY
</eg>

<p><emph>The following properties apply to this formatting object:</emph></p><slist>
<sitem><specref ref="common-border-padding-and-background-properties"/></sitem>
<sitem><specref ref="clip"/></sitem>
<sitem><specref ref="display-align"/></sitem>
<sitem><specref ref="extent"/></sitem>
<sitem><specref ref="overflow"/></sitem>
<sitem><specref ref="region-name"/></sitem>
<sitem><specref ref="reference-orientation"/></sitem>
<sitem><specref ref="writing-mode"/></sitem>
</slist>
</div3>


<div3 id="fo_flow"><head>fo:flow</head>

<p><emph>Common Usage:</emph></p>
<p>The content of the fo:flow formatting object is a
sequence of
flow objects that provides the flowing text content that is
distributed into pages.</p>

<p><emph>Areas:</emph></p>
<p>The fo:flow formatting object does not generate any areas.  The
fo:flow formatting object returns a sequence of areas created by
concatenating the sequences of areas returned by each of the children
of the fo:flow. The order of concatenation is the same order as the
children are ordered under the fo:flow.
</p>

<p><emph>Constraints:</emph></p>
<p>The (implicit) flow-map determines the assignment of the content
of the fo:flow to a region.
</p>

<p><emph>Contents:</emph></p>
<eg xml:space="preserve">
(<loc href="#block.fo.list" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">%block;</loc>)+
</eg>

<p>In addition this formatting object may have a sequence of
zero or more fo:markers as its initial children.</p>

<p><emph>The following properties apply to this formatting object:</emph></p><slist>
<sitem><specref ref="flow-name"/></sitem>
</slist>
</div3>


<div3 id="fo_static-content"><head>fo:static-content</head>

<p><emph>Common Usage:</emph></p>
<p>The
fo:static-content formatting object holds a sequence or a
tree of
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. </p>
<p>
This content is repeated, in its
entirety, on every page to which it is assigned.
</p>

<p><emph>Areas:</emph></p>
<p>The fo:static-content formatting object does not generate any areas.
The fo:static-content formatting object returns the sequence of areas
created by concatenating the sequences of areas returned by each of
the children of the fo:static-content. The order of concatenation is the same
order as the children are ordered under the fo:static-content.
</p>

<p><emph>Constraints:</emph></p>
<p>The (implicit) flow-map determines the assignment of the content
of the fo:static-content to a region.</p>
<p>The fo:static-content may be processed multiple times and thus the
default ordering constraint of section <specref ref="area-genorder"/>
does not apply to the fo:static-content. Instead, it must satisfy the
constraint on a per-page basis. Specifically, if <var>P</var> is a page-reference-area,<spot id="jm010109_45"/>
<var>C</var> is an area-class, and <var>S</var> is the set of all descendants of <var>P</var>
of area-class <var>C</var> returned to the fo:static-content descendant, then <var>S</var>
must be properly-ordered.</p>

<p><emph>Contents:</emph></p>
<eg xml:space="preserve">
(<loc href="#block.fo.list" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">%block;</loc>)+
</eg>

<p><emph>The following properties apply to this formatting object:</emph></p><slist>
<sitem><specref ref="flow-name"/></sitem>
</slist>
</div3>


<div3 id="fo_title"><head>fo:title</head>

<p><emph>Common Usage:</emph></p>
<p>
The fo:title formatting object is used to associate a title with a
given page-sequence. This title may be used by an interactive User Agent to
identify the pages. For example, the content of the fo:title can be
formatted and displayed in a "title" window or in a "tool tip".
</p>

<p><emph>Areas:</emph></p>
<p>
This formatting object returns the sequence of areas returned by the
children of this formatting object.
</p>

<p><emph>Constraints:</emph></p>
<p>
The sequence of returned areas must be the concatenation of the
sub-sequences of areas returned by each of the flow children of the
fo:title formatting object in the order in which the children occur.
</p>

<p><emph>Contents:</emph></p>
<eg xml:space="preserve">
(#PCDATA|<loc href="#inline.fo.list" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">%inline;</loc>)*
</eg>
<p><spot id="fo0001_16aa"/>An fo:title is not permitted to
have an fo:float, fo:footnote or fo:marker as a descendant.</p>
<p>Additionally, an fo:title is not permitted to have as a descendant
an fo:block-container that generates an absolutely positioned area.</p>

<p><emph>The following properties apply to this formatting object:</emph></p><slist>
<sitem><specref ref="common-accessibility-properties"/></sitem>
<sitem><specref ref="common-aural-properties"/></sitem>
<sitem><specref ref="common-border-padding-and-background-properties"/></sitem>
<sitem><specref ref="common-font-properties"/></sitem>
<sitem><specref ref="common-margin-properties-inline"/></sitem>
<sitem><specref ref="color"/></sitem>
<sitem><specref ref="line-height"/></sitem>
<sitem><specref ref="visibility"/></sitem>
</slist>
</div3>


</div2>

<div2>
<head>Block-level Formatting Objects</head>

<div3><head>Introduction</head>
<p>The fo:block formatting object is used for formatting
paragraphs, titles, figure captions, table titles, etc.  The
following example illustrates the usage of the fo:block in a
<spot id="js010061_11"/>stylesheet.</p>
<div4><head>Example</head>


<div5><head>Chapter and Section Titles, Paragraphs</head>
<p><spot id="aj000035_27"/>Input sample:</p>
<eg xml:space="preserve">
&lt;doc&gt;
  &lt;chapter&gt;
    &lt;title&gt;Chapter title&lt;/title&gt;
    &lt;section&gt;
      &lt;title&gt;First section title&lt;/title&gt;
      &lt;paragraph&gt;Section one's first paragraph.&lt;/paragraph&gt;
      &lt;paragraph&gt;Section one's second paragraph.&lt;/paragraph&gt;
    &lt;/section&gt;
    &lt;section&gt;
      &lt;title&gt;Second section title&lt;/title&gt;
      &lt;paragraph&gt;Section two's only paragraph.&lt;/paragraph&gt;
    &lt;/section&gt;
  &lt;/chapter&gt;
&lt;/doc&gt;
</eg>
<p>In this example the chapter title appears at the top of
the page (its "space-before" is discarded).</p>
<p>Space between chapter title
and first section title is (8pt,8pt,8pt): the chapter title's
"space-after"
has a higher precedence than the section title's "space-before"
(which takes
on the initial value of zero), so the latter is discarded.</p>
<p>Space between
the first section title and section one's first paragraph is
(6pt,6pt,6pt):
the section title's "space-after" has higher precedence than
the paragraph's
"space-before", so the latter is discarded.</p>
<p>Space between the two paragraphs
is (6pt,8pt,10pt): the "space-after" the first paragraph is
discarded because
its precedence is equal to that of the "space-before" the
next paragraph,
and the optimum of the "space-after" of the first paragraph
is greater than
the optimum of the "space-before" of the second paragraph.</p>
<p>Space between
the second paragraph of the first section and the title of
the second section
is (12pt,12pt,12pt): the "space-after" the paragraph is
discarded because
its precedence is equal to that of the "space-before" of
the section title,
and the optimum of the "space-after" of the paragraph is
less than the optimum
of the "space-before" of the section title.</p>
<p>The indent on the first
line of the first paragraph in section one and the only
paragraph in section
two is zero; the indent on the first line of the second
paragraph in section
one is 2pc.</p>
<p>XSL Stylesheet:</p>
<eg xml:space="preserve">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:fo="http://www.w3.org/1999/XSL/Format"&gt;

&lt;xsl:template match="chapter"&gt;
  &lt;fo:block break-before="page"&gt;
    &lt;xsl:apply-templates/&gt;
  &lt;/fo:block&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match="chapter/title"&gt;
  &lt;fo:block text-align="center" space-after="8pt"
            space-before="16pt" space-after.precedence="3"&gt;
    &lt;xsl:apply-templates/&gt;
  &lt;/fo:block&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match="section"&gt;
  &lt;xsl:apply-templates/&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match="section/title"&gt;
  &lt;fo:block text-align="center" space-after="6pt"
            space-before="12pt" space-before.precedence="0"
            space-after.precedence="3"&gt;
    &lt;xsl:apply-templates/&gt;
  &lt;/fo:block&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match="paragraph[1]" priority="1"&gt;
  &lt;fo:block text-indent="0pc" space-after="7pt"
            space-before.minimum="6pt" space-before.optimum="8pt"
            space-before.maximum="10pt"&gt;
    &lt;xsl:apply-templates/&gt;
  &lt;/fo:block&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match="paragraph"&gt;
  &lt;fo:block text-indent="2pc" space-after="7pt"
            space-before.minimum="6pt" space-before.optimum="8pt"
            space-before.maximum="10pt"&gt;
    &lt;xsl:apply-templates/&gt;
  &lt;/fo:block&gt;
&lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;
</eg>
<p>Result Instance: elements and attributes in the fo:
namespace</p>
<eg xml:space="preserve">
&lt;fo:block break-before="page"&gt;

  &lt;fo:block text-align="center" space-after="8pt"
    space-before="16pt"
    space-after.precedence="3"&gt;Chapter title
  &lt;/fo:block&gt;

  &lt;fo:block text-align="center" space-after="6pt"
    space-before="12pt" space-before.precedence="0"
    space-after.precedence="3"&gt;First section title
  &lt;/fo:block&gt;

  &lt;fo:block text-indent="0pc" space-after="7pt"
    space-before.minimum="6pt" space-before.optimum="8pt"
    space-before.maximum="10pt"&gt;Section one's first paragraph.
  &lt;/fo:block&gt;

  &lt;fo:block text-indent="2pc" space-after="7pt"
    space-before.minimum="6pt" space-before.optimum="8pt"
    space-before.maximum="10pt"&gt;Section one's second paragraph.
  &lt;/fo:block&gt;

  &lt;fo:block text-align="center" space-after="6pt"
    space-before="12pt" space-before.precedence="0"
    space-after.precedence="3"&gt;Second section title
  &lt;/fo:block&gt;

  &lt;fo:block text-indent="0pc" space-after="7pt"
    space-before.minimum="6pt" space-before.optimum="8pt"
    space-before.maximum="10pt"&gt;Section two's only paragraph.
  &lt;/fo:block&gt;

&lt;/fo:block&gt;
</eg>
</div5>

</div4>
</div3>


<div3 id="fo_block"><head>fo:block</head>


<p><emph>Common Usage:</emph></p>
<p>The fo:block formatting object is commonly used for formatting paragraphs,
titles, headlines, figure and table captions, etc.</p>

<p><emph>Areas:</emph></p>
<p>The fo:block formatting object generates one or more
<term>normal</term> block-areas.
The fo:block returns these areas, any
<term>page-level-out-of-line</term> areas, and
any <term>reference-level-out-of-line</term> areas
returned by the children of the fo:block.
The fo:block also generates zero or more line-areas as children of the
normal block-areas it returns, in accordance with
<specref ref="area-linebuild"/>.</p>

<p><emph>Trait Derivation:</emph></p>

<p>The .minimum, .optimum, and .maximum components of the
<trait>half-leading</trait> trait
<spot id="aj000035_28"/>are set to 1/2 the difference of
the computed value of the <trait>line-height</trait> property and the
computed value of the sum of the
<trait>text-altitude</trait> and <trait>text-depth</trait> properties.
The .precedence and .conditionality components are copied from the
<trait>line-height</trait> property.</p>
<note>
<p>The <spot id="jm010109_46"/>usage of the half-leading is described in <specref ref="area-line"/>.</p>
</note>

<p><emph>Constraints:</emph></p>
<p>No area may have more than one normal child area
returned by the same fo:block formatting object.</p>
<p>The children of each normal area generated by an fo:block
must satisfy the constraints specified in <specref ref="area-linebuild"/>.
</p>
<p>In addition the constraints imposed by the traits derived from the
properties applicable to this formatting object must be satisfied.
The geometric constraints are rigorously defined in <specref ref="area_model"/>.</p>

<p><emph>Contents:</emph></p>
<eg xml:space="preserve">
(#PCDATA|<loc href="#inline.fo.list" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">%inline;</loc>|<loc href="#block.fo.list" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">%block;</loc>)*
</eg>

<p>In addition this formatting object may have a sequence of
zero or more fo:markers as its initial children,
optionally followed by an fo:initial-property-set.
</p>

<p><emph>The following properties apply to this formatting object:</emph></p><slist>
<sitem><specref ref="common-accessibility-properties"/></sitem>
<sitem><specref ref="common-aural-properties"/></sitem>
<sitem><specref ref="common-border-padding-and-background-properties"/></sitem>
<sitem><specref ref="common-font-properties"/></sitem>
<sitem><specref ref="common-hyphenation-properties"/></sitem>

<sitem><specref ref="common-margin-properties-block"/></sitem>
<sitem><specref ref="common-relative-position-properties"/></sitem>
<sitem><specref ref="break-after"/></sitem>
<sitem><specref ref="break-before"/></sitem>
<sitem><specref ref="color"/></sitem>
<sitem><specref ref="text-depth"/></sitem>
<sitem><specref ref="text-altitude"/></sitem>
<sitem><specref ref="hyphenation-keep"/></sitem>
<sitem><specref ref="hyphenation-ladder-count"/></sitem>
<sitem><specref ref="id"/></sitem>
<sitem><specref ref="intrusion-displace"/></sitem>
<sitem><specref ref="keep-together"/></sitem>
<sitem><specref ref="keep-with-next"/></sitem>
<sitem><specref ref="keep-with-previous"/></sitem>
<sitem><specref ref="last-line-end-indent"/></sitem>
<sitem><specref ref="linefeed-treatment"/></sitem>
<sitem><specref ref="line-height"/></sitem>
<sitem><specref ref="line-height-shift-adjustment"/></sitem>
<sitem><specref ref="line-stacking-strategy"/></sitem>
<sitem><specref ref="orphans"/></sitem>

<sitem><specref ref="white-space-treatment"/></sitem>
<sitem><specref ref="span"/></sitem>
<sitem><specref ref="text-align"/></sitem>
<sitem><specref ref="text-align-last"/></sitem>
<sitem><specref ref="text-indent"/></sitem>
<sitem><specref ref="visibility"/></sitem>

<sitem><specref ref="white-space-collapse"/></sitem>
<sitem><specref ref="widows"/></sitem>
<sitem><specref ref="wrap-option"/></sitem>
</slist>
</div3>


<div3 id="fo_block-container"><head>fo:block-container</head>

<p><emph>Common Usage:</emph></p>
<p>The fo:block-container flow object is used to
generate a block-level reference-area, typically containing
text blocks with a different writing-mode.  In addition, it
can also be used with a different reference-orientation to
rotate its content.
</p>
<note><p>The use of this flow object is not required for
changing
the inline-progression-direction only; in that case the Unicode <spot id="js010061_13"/>BIDI
algorithm and the fo:bidi-override are sufficient.</p>
</note>

<p><emph>Areas:</emph></p>
<p>The fo:block-container formatting object generates one or more
<term>viewport/reference pair</term>s.
The fo:block-container returns these areas and any
<term>page-level-out-of-line</term> areas
returned by the children of the fo:block-container.</p>

<p><emph>Trait Derivation:</emph></p>
<p>The areas generated by the fo:block-container formatting object have
a value of "true" for the <trait>is-reference-area</trait>.</p>
<p>The size of the viewport-area and the reference-area
has to be fixed in the inline-progression-direction.
It must be specified
unless the inline-progression-direction is parallel to the
inline-progression-direction of the reference-area into
which
the areas generated by this flow object are placed.</p>

<p><emph>Constraints:</emph></p>
<p><spot id="fo0001ab_a"/>The children of each reference-area generated
by an fo:block-container formatting object
must be normal <term>block-area</term>s returned by the children of the fo:block-container,
must be <term>properly stacked</term>, and
must be <term>properly ordered</term>.
</p>
<p>Any <term>reference-level-out-of-line</term>
areas returned by the children of the fo:block-container
are handled as described in <specref ref="fo_float"/>.</p>

<p><emph>Contents:</emph></p>
<eg xml:space="preserve">
(<loc href="#block.fo.list" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">%block;</loc>)+
</eg>

<p>In addition an fo:block-container that does not generate
an <term>absolutely positioned</term> area
may have a sequence of
zero or more fo:markers as its initial children.</p>

<p><emph>The following properties apply to this formatting object:</emph></p><slist>
<sitem><specref ref="common-absolute-position-properties"/></sitem>
<sitem><specref ref="common-border-padding-and-background-properties"/></sitem>

<sitem><specref ref="common-margin-properties-block"/></sitem>
<sitem><specref ref="block-progression-dimension"/></sitem>
<sitem><specref ref="break-after"/></sitem>
<sitem><specref ref="break-before"/></sitem>
<sitem><specref ref="clip"/></sitem>
<sitem><specref ref="display-align"/></sitem>
<sitem><specref ref="height"/></sitem>
<sitem><specref ref="id"/></sitem>
<sitem><specref ref="inline-progression-dimension"/></sitem>
<sitem><specref ref="intrusion-displace"/></sitem>
<sitem><specref ref="keep-together"/></sitem>
<sitem><specref ref="keep-with-next"/></sitem>
<sitem><specref ref="keep-with-previous"/></sitem>
<sitem><specref ref="overflow"/></sitem>
<sitem><specref ref="reference-orientation"/></sitem>
<sitem><specref ref="span"/></sitem>
<sitem><specref ref="width"/></sitem>
<sitem><specref ref="writing-mode"/></sitem>
<sitem><specref ref="z-index"/></sitem>
</slist>
</div3>

</div2>

<div2>
<head>Inline-level Formatting Objects</head>

<div3><head>Introduction</head>
<p>Inline-level formatting objects are most commonly used to
format
a portion of text or for generating rules and leaders. There
are many other uses.  The following examples illustrate
some of these uses of inline-level formatting objects.</p>
<ulist><item><p>
putting the first line of a paragraph into
small-caps,</p></item>
<item><p>turning a normally inline formatting object, fo:external-graphic, into
a block by "wrapping" with an fo:block formatting
object,</p></item>
<item><p>formatting a running footer containing the word
"Page" followed by a page number.</p></item></ulist>
<div4><head>Examples</head>



<div5><head>First Line of Paragraph in Small-caps</head>
<p>Input sample:</p>
<eg xml:space="preserve">
&lt;doc&gt;
&lt;p&gt;This is the text of a paragraph that is going to be
presented with the first line in small-caps.&lt;/p&gt;
&lt;/doc&gt;
</eg>
<p>XSL Stylesheet:</p>
<eg xml:space="preserve">
&lt;?xml version='1.0'?&gt;
&lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:fo="http://www.w3.org/1999/XSL/Format"
                version='1.0'&gt;

&lt;xsl:template match="p"&gt;
  &lt;fo:block&gt;
    &lt;fo:initial-property-set font-variant="small-caps"/&gt;
    &lt;xsl:apply-templates/&gt;
  &lt;/fo:block&gt;
&lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;
</eg>
<p>Result instance: elements and attributes in the fo:
namespace</p>
<eg xml:space="preserve">
&lt;fo:block&gt;
  &lt;fo:initial-property-set font-variant="small-caps"&gt;
  &lt;/fo:initial-property-set&gt;This is the text of a paragraph that is going to be
presented with the first line in small-caps.
&lt;/fo:block&gt;
</eg>
</div5>

<div5><head>Figure with a Photograph</head>
<p>Input sample:</p>
<eg xml:space="preserve">
&lt;doc&gt;
  &lt;figure&gt;
    &lt;photo image="TH0317A.jpg"/&gt;
    &lt;caption&gt;C'ieng Tamlung of C'ieng Mai&lt;/caption&gt;
  &lt;/figure&gt;
&lt;/doc&gt;
</eg>
<p>In this example the image (an fo:external-graphic) is
placed as a centered block-level object.
The caption is centered with 10mm indents.</p>
<p>XSL Stylesheet:</p>
<eg xml:space="preserve">
&lt;?xml version='1.0'?&gt;
&lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:fo="http://www.w3.org/1999/XSL/Format"
                version='1.0'&gt;

&lt;xsl:template match="figure"&gt;
  &lt;fo:block&gt;
    &lt;xsl:apply-templates/&gt;
  &lt;/fo:block&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match="photo"&gt;
  &lt;fo:block text-align="center"&gt;
    &lt;fo:external-graphic src="{@image}"/&gt;
  &lt;/fo:block&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match="caption"&gt;
  &lt;fo:block space-before="3pt" text-align="center"
    start-indent="10mm" end-indent="10mm"&gt;
    &lt;xsl:apply-templates/&gt;
  &lt;/fo:block&gt;
&lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;
</eg>
<p>fo: element and attribute tree:</p>
<eg xml:space="preserve">
&lt;fo:block&gt;
  &lt;fo:block text-align="center"&gt;
    &lt;fo:external-graphic src="TH0317A.jpg"/&gt;
  &lt;/fo:block&gt;

  &lt;fo:block space-before="3pt" text-align="center" start-indent="10mm"
    end-indent="10mm"&gt;C'ieng Tamlung of C'ieng Mai&lt;/fo:block&gt;
&lt;/fo:block&gt;
</eg>
</div5>

<div5><head>Page numbering and page number reference</head>
<p>Input sample:</p>
<eg xml:space="preserve">
&lt;!DOCTYPE doc SYSTEM "pgref.dtd"&gt;
&lt;doc&gt;
  &lt;chapter id="x"&gt;&lt;title&gt;Chapter&lt;/title&gt;
    &lt;p&gt;Text&lt;/p&gt;
  &lt;/chapter&gt;
  &lt;chapter&gt;&lt;title&gt;Chapter&lt;/title&gt;
    &lt;p&gt;For a description of X see &lt;ref refid="x"/&gt;.&lt;/p&gt;
  &lt;/chapter&gt;
&lt;/doc&gt;
</eg>
<p>In this example each page has a running footer containing the word
"Page" followed by the page number. The "ref" element generates the
word "page" followed by the page number of the page on which the
referenced by the "refid" attribute was placed.</p>
<p>XSL Stylesheet:</p>
<eg xml:space="preserve">
&lt;?xml version='1.0'?&gt;
&lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:fo="http://www.w3.org/1999/XSL/Format"
                version='1.0'&gt;

&lt;xsl:template match="doc"&gt;
  &lt;fo:root&gt;
    &lt;fo:layout-master-set&gt;
      &lt;fo:simple-page-master master-name="page"
        page-height="297mm" page-width="210mm"
        margin-top="20mm" margin-bottom="10mm"
        margin-left="25mm" margin-right="25mm"&gt;
        &lt;fo:region-body
          margin-top="0mm" margin-bottom="15mm"
          margin-left="0mm" margin-right="0mm"/&gt;
        &lt;fo:region-after extent="10mm"/&gt;
      &lt;/fo:simple-page-master&gt;
    &lt;/fo:layout-master-set&gt;
    &lt;fo:page-sequence master-reference="page"&gt;
      &lt;fo:static-content flow-name="xsl-region-after"&gt;
        &lt;fo:block&gt;
          &lt;xsl:text&gt;Page &lt;/xsl:text&gt;
          &lt;fo:page-number/&gt;
        &lt;/fo:block&gt;
      &lt;/fo:static-content&gt;
      &lt;fo:flow flow-name="xsl-region-body"&gt;
        &lt;xsl:apply-templates/&gt;
      &lt;/fo:flow&gt;
    &lt;/fo:page-sequence&gt;
  &lt;/fo:root&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match="chapter/title"&gt;
  &lt;fo:block id="{generate-id(.)}"&gt;
    &lt;xsl:number level="multiple" count="chapter" format="1. "/&gt;
    &lt;xsl:apply-templates/&gt;
  &lt;/fo:block&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match="p"&gt;
  &lt;fo:block&gt;
    &lt;xsl:apply-templates/&gt;
  &lt;/fo:block&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match="ref"&gt;
  &lt;xsl:text&gt;page &lt;/xsl:text&gt;
  &lt;fo:page-number-citation refid="{generate-id(id(@refid)/title)}"/&gt;
&lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;
</eg>
<p>Result Instance: elements and attributes in the fo:
namespace</p>
<eg xml:space="preserve">
&lt;fo:root&gt;
  &lt;fo:layout-master-set&gt;
    &lt;fo:simple-page-master master-name="page"
      page-height="297mm" page-width="210mm"
      margin-top="20mm" margin-bottom="10mm"
      margin-left="25mm" margin-right="25mm"&gt;
      &lt;fo:region-body margin-top="0mm" margin-bottom="15mm"
        margin-left="0mm" margin-right="0mm"/&gt;
      &lt;fo:region-after extent="10mm"/&gt;
    &lt;/fo:simple-page-master&gt;
  &lt;/fo:layout-master-set&gt;
  &lt;fo:page-sequence master-reference="page"&gt;
    &lt;fo:static-content flow-name="xsl-region-after"&gt;
      &lt;fo:block&gt;Page &lt;fo:page-number/&gt;
      &lt;/fo:block&gt;
    &lt;/fo:static-content&gt;
    &lt;fo:flow flow-name="xsl-region-body"&gt;
      &lt;fo:block id="N5"&gt;1. Chapter&lt;/fo:block&gt;
      &lt;fo:block&gt;Text&lt;/fo:block&gt;
      &lt;fo:block id="N13"&gt;2. Chapter&lt;/fo:block&gt;
      &lt;fo:block&gt;For a description of X see page &lt;fo:page-number-citation refid="N5"/&gt;
      &lt;/fo:block&gt;
    &lt;/fo:flow&gt;
  &lt;/fo:page-sequence&gt;
&lt;/fo:root&gt;
</eg>
</div5>

<div5><head>Table of Contents with Leaders</head>
<p><spot id="od000147_1"/>Input sample:</p>
<eg xml:space="preserve">
&lt;doc&gt;
  &lt;chapter&gt;&lt;title&gt;Chapter&lt;/title&gt;
    &lt;p&gt;Text&lt;/p&gt;
    &lt;section&gt;&lt;title&gt;Section&lt;/title&gt;
    &lt;p&gt;Text&lt;/p&gt;
    &lt;/section&gt;
    &lt;section&gt;&lt;title&gt;Section&lt;/title&gt;
    &lt;p&gt;Text&lt;/p&gt;
    &lt;/section&gt;
  &lt;/chapter&gt;
  &lt;chapter&gt;&lt;title&gt;Chapter&lt;/title&gt;
    &lt;p&gt;Text&lt;/p&gt;
    &lt;section&gt;&lt;title&gt;Section&lt;/title&gt;
    &lt;p&gt;Text&lt;/p&gt;
    &lt;/section&gt;
    &lt;section&gt;&lt;title&gt;Section&lt;/title&gt;
    &lt;p&gt;Text&lt;/p&gt;
    &lt;/section&gt;
  &lt;/chapter&gt;
&lt;/doc&gt;
</eg>
<p>In this example the table of contents is formatted with a dot leader
between the heading text and the page number.</p>
<p>XSL Stylesheet:</p>
<eg xml:space="preserve">
&lt;?xml version='1.0'?&gt;
&lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:fo="http://www.w3.org/1999/XSL/Format"
                version='1.0'&gt;

&lt;xsl:template match="doc"&gt;
  &lt;!-- create the table of contents --&gt;
  &lt;xsl:apply-templates select="chapter/title" mode="toc"/&gt;
  &lt;!-- do the document --&gt;
  &lt;xsl:apply-templates/&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match="chapter/title" mode="toc"&gt;
  &lt;fo:block text-align-last="justify"&gt;
    &lt;fo:simple-link internal-destination="{generate-id(.)}"&gt;
      &lt;xsl:number level="multiple" count="chapter" format="1. "/&gt;
      &lt;xsl:apply-templates/&gt;
    &lt;/fo:simple-link&gt;
    &lt;xsl:text&gt; &lt;/xsl:text&gt;
    &lt;fo:leader leader-length.minimum="12pt" leader-length.optimum="40pt"
               leader-length.maximum="100%" leader-pattern="dots"/&gt;
    &lt;xsl:text&gt; &lt;/xsl:text&gt;
    &lt;fo:page-number-citation ref-id="{generate-id(.)}"/&gt;
  &lt;/fo:block&gt;
  &lt;xsl:apply-templates select="../section/title" mode="toc"/&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match="section/title" mode="toc"&gt;
  &lt;fo:block start-indent="10mm" text-align-last="justify"&gt;
    &lt;fo:simple-link internal-destination="{generate-id(.)}"&gt;
      &lt;xsl:number level="multiple" count="chapter|section" format="1.1 "/&gt;
      &lt;xsl:apply-templates/&gt;
    &lt;/fo:simple-link&gt;
    &lt;xsl:text&gt; &lt;/xsl:text&gt;
    &lt;fo:leader leader-length.minimum="12pt" leader-length.optimum="40pt"
               leader-length.maximum="100%" leader-pattern="dots"/&gt;
    &lt;xsl:text&gt; &lt;/xsl:text&gt;
    &lt;fo:page-number-citation ref-id="{generate-id(.)}"/&gt;
  &lt;/fo:block&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match="chapter/title"&gt;
  &lt;fo:block id="{generate-id(.)}"&gt;
    &lt;xsl:number level="multiple" count="chapter" format="1. "/&gt;
    &lt;xsl:apply-templates/&gt;
  &lt;/fo:block&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match="section/title"&gt;
  &lt;fo:block id="{generate-id(.)}"&gt;
    &lt;xsl:number level="multiple" count="chapter|section" format="1.1 "/&gt;
    &lt;xsl:apply-templates/&gt;
  &lt;/fo:block&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match="p"&gt;
  &lt;fo:block&gt;
    &lt;xsl:apply-templates/&gt;
  &lt;/fo:block&gt;
&lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;
</eg>
<p>Result Instance: elements and attributes in the fo:
namespace</p>
<eg xml:space="preserve">
&lt;fo:block text-align-last="justify"&gt;
  &lt;fo:simple-link internal-destination="N4"&gt;1. Chapter
  &lt;/fo:simple-link&gt;
  &lt;fo:leader leader-length.minimum="12pt" leader-length.optimum="40pt"
    leader-length.maximum="100%" leader-pattern="dots"&gt;
  &lt;/fo:leader&gt;
  &lt;fo:page-number-citation ref-id="N4"&gt;
  &lt;/fo:page-number-citation&gt;
&lt;/fo:block&gt;
&lt;fo:block start-indent="10mm" text-align-last="justify"&gt;
  &lt;fo:simple-link internal-destination="N11"&gt;1.1 Section
  &lt;/fo:simple-link&gt;
  &lt;fo:leader leader-length.minimum="12pt" leader-length.optimum="40pt"
    leader-length.maximum="100%" leader-pattern="dots"&gt;
  &lt;/fo:leader&gt;
  &lt;fo:page-number-citation ref-id="N11"&gt;
  &lt;/fo:page-number-citation&gt;
&lt;/fo:block&gt;
&lt;fo:block start-indent="10mm" text-align-last="justify"&gt;
  &lt;fo:simple-link internal-destination="N19"&gt;1.2 Section
  &lt;/fo:simple-link&gt;
  &lt;fo:leader leader-length.minimum="12pt" leader-length.optimum="40pt"
    leader-length.maximum="100%" leader-pattern="dots"&gt;
  &lt;/fo:leader&gt;
  &lt;fo:page-number-citation ref-id="N19"&gt;
  &lt;/fo:page-number-citation&gt;
&lt;/fo:block&gt;
&lt;fo:block text-align-last="justify"&gt;
  &lt;fo:simple-link internal-destination="N28"&gt;2. Chapter
  &lt;/fo:simple-link&gt;
  &lt;fo:leader leader-length.minimum="12pt" leader-length.optimum="40pt"
    leader-length.maximum="100%" leader-pattern="dots"&gt;
  &lt;/fo:leader&gt;
  &lt;fo:page-number-citation ref-id="N28"&gt;
  &lt;/fo:page-number-citation&gt;
&lt;/fo:block&gt;
&lt;fo:block start-indent="10mm" text-align-last="justify"&gt;
  &lt;fo:simple-link internal-destination="N35"&gt;2.1 Section
  &lt;/fo:simple-link&gt;
  &lt;fo:leader leader-length.minimum="12pt" leader-length.optimum="40pt"
    leader-length.maximum="100%" leader-pattern="dots"&gt;
  &lt;/fo:leader&gt;
  &lt;fo:page-number-citation ref-id="N35"&gt;
  &lt;/fo:page-number-citation&gt;
&lt;/fo:block&gt;
&lt;fo:block start-indent="10mm" text-align-last="justify"&gt;
  &lt;fo:simple-link internal-destination="N43"&gt;2.2 Section
  &lt;/fo:simple-link&gt;
  &lt;fo:leader leader-length.minimum="12pt" leader-length.optimum="40pt"
    leader-length.maximum="100%" leader-pattern="dots"&gt;
  &lt;/fo:leader&gt;
  &lt;fo:page-number-citation ref-id="N43"&gt;
  &lt;/fo:page-number-citation&gt;
&lt;/fo:block&gt;

&lt;fo:block id="N4"&gt;1. Chapter
&lt;/fo:block&gt;

&lt;fo:block&gt;Text
&lt;/fo:block&gt;

&lt;fo:block id="N11"&gt;1.1 Section
&lt;/fo:block&gt;

&lt;fo:block&gt;Text
&lt;/fo:block&gt;

&lt;fo:block id="N19"&gt;1.2 Section
&lt;/fo:block&gt;

&lt;fo:block&gt;Text
&lt;/fo:block&gt;

&lt;fo:block id="N28"&gt;2. Chapter
&lt;/fo:block&gt;

&lt;fo:block&gt;Text
&lt;/fo:block&gt;

&lt;fo:block id="N35"&gt;2.1 Section
&lt;/fo:block&gt;

&lt;fo:block&gt;Text
&lt;/fo:block&gt;

&lt;fo:block id="N43"&gt;2.2 Section
&lt;/fo:block&gt;

&lt;fo:block&gt;Text
&lt;/fo:block&gt;
</eg>
</div5>

</div4>
</div3>


<div3 id="fo_bidi-override"><head>fo:bidi-override</head>

<p><emph>Common Usage:</emph></p>
<p>The fo:bidi-override formatting object is used when the Unicode <spot id="js010061_14"/>BIDI
algorithm fails. It forces a string of text to be written in a specific
direction.</p>

<p><emph>Areas:</emph></p>
<p>The fo:bidi-override formatting object generates one or more
<term>normal</term> <term>inline-area</term>s.
The fo:bidi-override returns these areas, any
<term>page-level-out-of-line</term> areas, and
any <term>reference-level-out-of-line</term> areas
returned by the children of the fo:bidi-override.</p>

<p><emph>Trait Derivation:</emph></p>
<p>The direction traits are derived from the "writing-mode",
"direction", and "unicode-bidi" properties as described in
<specref ref="refine-writing-mode"/>.</p>

<p><emph>Constraints:</emph></p>
<p>No area may have more than one normal child area
returned by the same fo:bidi-override formatting object.</p>
<p>The children of each normal area returned by an fo:bidi-override
must satisfy the constraints specified in <specref ref="area-inlinebuild"/>.
</p>

<p><emph>Contents:</emph></p>
<eg xml:space="preserve">
(#PCDATA|<loc href="#inline.fo.list" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">%inline;</loc>|<loc href="#block.fo.list" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">%block;</loc>)*
</eg>

<p><spot id="fo0001_16a"/>In addition this formatting object may have a sequence of
zero or more fo:markers as its initial children.</p>
<p>An fo:bidi-override that is a descendant of an fo:leader or of
an fo:inline child
of an fo:footnote may not have block-level children,
unless it has a nearer ancestor that is an fo:inline-container.</p>

<p><emph>The following properties apply to this formatting object:</emph></p><slist>
<sitem><specref ref="common-aural-properties"/></sitem>
<sitem><specref ref="common-font-properties"/></sitem>
<sitem><specref ref="common-relative-position-properties"/></sitem>
<sitem><specref ref="color"/></sitem>
<sitem><specref ref="direction"/></sitem>
<sitem><specref ref="id"/></sitem>
<sitem><specref ref="letter-spacing"/></sitem>
<sitem><specref ref="line-height"/></sitem>
<sitem><specref ref="score-spaces"/></sitem>
<sitem><specref ref="unicode-bidi"/></sitem>
<sitem><specref ref="word-spacing"/></sitem>
</slist>
</div3>


<div3 id="fo_character"><head>fo:character</head>

<p><emph>Common Usage:</emph></p>
<p>The fo:character flow object represents a character that
is mapped to
a glyph for presentation. It is an atomic unit to the formatter.</p>
<p>When the result tree is interpreted as a tree of formatting objects,
a character in the result tree is treated as if it were an empty
element of type fo:character with a character attribute
equal to the Unicode representation of the character.
The <spot id="c11i61"/>semantics of an "auto" value for character properties, which is
typically their initial value,
are based on the Unicode code point. Overrides may be specified in
an implementation-specific manner.
</p>
<note>
<p>In a stylesheet the explicit creation of an fo:character may be
used to explicitly override the default mapping.</p>
</note>
<p><spot id="i18n_5a"/>Unicode <spot id="jm010109_47a"/>Tag Characters need not be supported.</p>
<note><p><spot id="jm010109_47b"/>Unicode Version 3.1, in fact,
states that they are not to be used
"with <emph>any</emph> protocols that provide alternate means for language tagging,
such as HTML or XML.".
Unicode TR20 (<bibref ref="UNICODE-TR20"/>) also
declares very clearly that they are not suitable together with
markup.</p>
</note>

<p><emph>Areas:</emph></p>
<p>The fo:character formatting object generates and returns
<spot id="no000049a"/>one or more
<term>normal</term> <term>inline-area</term>.</p>
<note><p>Cases where more than one <term>inline-area</term> is generated
are encountered in scripts where a single character generates both a
prefix and a suffix glyph to some other character.</p>
</note>

<p><emph>Constraints:</emph></p>
<p>The dimensions of the areas <spot id="jm010109_48"/>are determined by the font metrics for
the glyph.</p>
<p>When formatting an fo:character with a <spot id="jm010109_7b"/>"treat-as-word-space" value
of "true", the User Agent may use a different method for determining
the <trait>inline-progression-dimension</trait> of the area.</p>
<note><p><spot id="fo0001_10a"/>Such methods typically make use of
a <spot id="jm010109_7m"/>word space value stored in the font, or
a formatter defined <spot id="jm010109_7n"/>word space value.</p>
</note>

<p><emph>Contents:</emph></p>
<eg xml:space="preserve">
EMPTY
</eg>

<p><emph>The following properties apply to this formatting object:</emph></p><slist>
<sitem><specref ref="common-aural-properties"/></sitem>
<sitem><specref ref="common-border-padding-and-background-properties"/></sitem>
<sitem><specref ref="common-font-properties"/></sitem>
<sitem><specref ref="common-hyphenation-properties"/></sitem>

<sitem><specref ref="common-margin-properties-inline"/></sitem>
<sitem><specref ref="common-relative-position-properties"/></sitem>
<sitem><specref ref="alignment-adjust"/></sitem>
<sitem><specref ref="treat-as-word-space"/></sitem>
<sitem><specref ref="alignment-baseline"/></sitem>
<sitem><specref ref="baseline-shift"/></sitem>
<sitem><specref ref="character"/></sitem>
<sitem><specref ref="color"/></sitem>
<sitem><specref ref="dominant-baseline"/></sitem>
<sitem><specref ref="text-depth"/></sitem>
<sitem><specref ref="text-altitude"/></sitem>
<sitem><specref ref="glyph-orientation-horizontal"/></sitem>
<sitem><specref ref="glyph-orientation-vertical"/></sitem>
<sitem><specref ref="id"/></sitem>
<sitem><specref ref="keep-with-next"/></sitem>
<sitem><specref ref="keep-with-previous"/></sitem>
<sitem><specref ref="letter-spacing"/></sitem>
<sitem><specref ref="line-height"/></sitem>
<sitem><specref ref="score-spaces"/></sitem>
<sitem><specref ref="suppress-at-line-break"/></sitem>
<sitem><specref ref="text-decoration"/></sitem>
<sitem><specref ref="text-shadow"/></sitem>
<sitem><specref ref="text-transform"/></sitem>

<sitem><specref ref="visibility"/></sitem>
<sitem><specref ref="word-spacing"/></sitem>
</slist>
</div3>


<div3 id="fo_initial-property-set"><head>fo:initial-property-set</head>

<p><emph>Common Usage:</emph></p>
<p>The fo:initial-property-set auxiliary formatting object
specifies formatting properties
for the first line of an fo:block.</p>
<note><p>It is analogous to the CSS first-line pseudo-element.</p>
<p>In future versions of this <spot id="jm010109_10m"/>Recommendation a property controlling
the number of lines, or the "depth" that these initial properties
apply to may be added.</p>
</note>

<p><emph>Areas:</emph></p>
<p>The fo:initial-property-set formatting object does not generate
or return any areas. It simply holds a set of traits that are applicable
to the first line-area of the area that
has a value of "true" for the <trait>is-first</trait> trait and that was
generated by the parent fo:block of the fo:initial-property-set.
</p>

<p><emph>Trait Derivation:</emph></p>
<p>The traits on the fo:initial-property-set are taken into
account as traits constraining the first line as if
the child inline formatting objects of the fo:block,
or parts of them in the
case of a line-break, that were used in formatting
the first line were enclosed by an fo:wrapper, as a direct
child of the fo:block, with those traits.</p>

<p><emph>Constraints:</emph></p>
<p>None.</p>

<p><emph>Contents:</emph></p>
<eg xml:space="preserve">
EMPTY
</eg>

<p><emph>The following properties apply to this formatting object:</emph></p><slist>
<sitem><specref ref="common-accessibility-properties"/></sitem>
<sitem><specref ref="common-aural-properties"/></sitem>
<sitem><specref ref="common-border-padding-and-background-properties"/></sitem>
<sitem><specref ref="common-font-properties"/></sitem>
<sitem><specref ref="common-relative-position-properties"/></sitem>
<sitem><specref ref="color"/></sitem>
<sitem><specref ref="id"/></sitem>
<sitem><specref ref="letter-spacing"/></sitem>
<sitem><specref ref="line-height"/></sitem>
<sitem><specref ref="score-spaces"/></sitem>
<sitem><specref ref="text-decoration"/></sitem>
<sitem><specref ref="text-shadow"/></sitem>
<sitem><specref ref="text-transform"/></sitem>
<sitem><specref ref="word-spacing"/></sitem>
</slist>
</div3>


<div3 id="fo_external-graphic"><head>fo:external-graphic</head>

<p><emph>Common Usage:</emph></p>
<p>The fo:external-graphic flow object is used for a
<spot id="aj000035_29b"/>graphic where the graphics data resides outside of the fo:element tree.</p>

<p><emph>Areas:</emph></p>
<p>The fo:external-graphic
formatting object generates and returns one inline-level
viewport-area and one reference-area containing the external graphic.
The inline-level area uses the <term>large-allocation-rectangle</term>
as defined in <specref ref="area-geo"/>.
</p>
<note><p><spot id="aj000035_30"/>An fo:external-graphic may be placed
block-level by enclosing it in an fo:block.</p>
<p>A "line-stacking-strategy" of "max-height" or "line-height" is
<spot id="js010055_1"/>typically used for stacking one or more lines with fo:external-graphic
content.</p>
</note>

<p><emph>Constraints:</emph></p>
<p>The viewport's size is determined by the
<trait>block-progression-dimension</trait> and <trait>inline-progression-dimension</trait> traits.
For values of "auto", the content size of the graphic is used.
</p>
<p>The content size of a graphic is determined by taking the
intrinsic size of the graphic and scaling as specified by the
<trait>content-height</trait>, <trait>content-width</trait>,
and <trait>scaling</trait> traits. If one of the content-height or
content-width is not "auto", the same scale factor
(as calculated from the specified non-auto value) is applied equally to
both directions.
</p>
<p>Once scaled, the reference-area
is aligned with respect to the viewport-area
using the <trait>text-align</trait> and
<spot id="fo0001ab_da"/><trait>display-align</trait>
traits. If it is too large for the viewport-area,
the graphic is aligned as if it would fit and the <trait>overflow</trait>
trait controls the clipping, scroll bars, etc.
</p>
<p>In the case when the graphics format does not specify an intrinsic
size of the graphic the size is determined in an implementation-defined
manner.</p>
<note><p>For example, <spot id="jm010109_49"/>a size of 1/96" as the size
of one pixel for rasterized images may be used.</p>
</note>

<p><emph>Contents:</emph></p>
<eg xml:space="preserve">
EMPTY
</eg>

<p><emph>The following properties apply to this formatting object:</emph></p><slist>
<sitem><specref ref="common-accessibility-properties"/></sitem>
<sitem><specref ref="common-aural-properties"/></sitem>
<sitem><specref ref="common-border-padding-and-background-properties"/></sitem>

<sitem><specref ref="common-margin-properties-inline"/></sitem>
<sitem><specref ref="common-relative-position-properties"/></sitem>
<sitem><specref ref="alignment-adjust"/></sitem>
<sitem><specref ref="alignment-baseline"/></sitem>
<sitem><specref ref="baseline-shift"/></sitem>
<sitem><specref ref="block-progression-dimension"/></sitem>
<sitem><specref ref="clip"/></sitem>
<sitem><specref ref="content-height"/></sitem>
<sitem><specref ref="content-type"/></sitem>
<sitem><specref ref="content-width"/></sitem>
<sitem><specref ref="display-align"/></sitem>
<sitem><specref ref="dominant-baseline"/></sitem>
<sitem><specref ref="height"/></sitem>
<sitem><specref ref="id"/></sitem>
<sitem><specref ref="inline-progression-dimension"/></sitem>
<sitem><specref ref="keep-with-next"/></sitem>
<sitem><specref ref="keep-with-previous"/></sitem>
<sitem><specref ref="line-height"/></sitem>
<sitem><specref ref="overflow"/></sitem>
<sitem><specref ref="scaling"/></sitem>
<sitem><specref ref="scaling-method"/></sitem>
<sitem><specref ref="src"/></sitem>
<sitem><specref ref="text-align"/></sitem>

<sitem><specref ref="width"/></sitem>
</slist>
</div3>


<div3 id="fo_instream-foreign-object"><head>fo:instream-foreign-object</head>

<p><emph>Common Usage:</emph></p>
<p>The fo:instream-foreign-object flow object is used for an inline
graphic or other "generic" object
where the object data resides as descendants of the
fo:instream-foreign-object, typically as an XML element subtree in
a non-XSL namespace.</p>
<note>
<p>A common format is SVG.</p>
</note>

<p><emph>Areas:</emph></p>
<p>The fo:instream-foreign-object
formatting object generates and returns one inline
viewport-area and one reference-area containing the instream-foreign-object.
The inline-level area uses the <term>large-allocation-rectangle</term>
as defined in <specref ref="area-geo"/>.
</p>

<p><emph>Constraints:</emph></p>
<p><spot id="aj000035_31"/>The viewport's size is determined by the
<trait>block-progression-dimension</trait> and <trait>inline-progression-dimension</trait> traits.
For values of "auto", the content size of the instream foreign object is used.
</p>
<p>The content size of an instream-foreign-object is determined by taking the
intrinsic size of the object and scaling as specified by the
<trait>content-height</trait>, <trait>content-width</trait>,
and <trait>scaling</trait> traits. If one of the content-height or
content-width is not "auto", the same scale factor
(as calculated from the specified non-auto value) is applied equally to
both directions.
</p>
<p>Once scaled, the reference-area
is aligned with respect to the viewport-area
using the <trait>text-align</trait> and
<spot id="fo0001ab_db"/><trait>display-align</trait>
traits. If it is too large for the viewport-area,
the instream-foreign-object is aligned as if it would fit and the <trait>overflow</trait>
trait controls the clipping, scroll bars, etc.
</p>
<p>In the case when the instream-foreign-object does not specify an intrinsic
size of the object, the size is determined in an implementation defined
manner.</p>

<p><emph>Contents:</emph></p>
<p>The fo:instream-foreign-object flow object has
<spot id="fo01jr_3a"/>a child from a non-XSL
namespace. The permitted structure of <spot id="fo01jr_3b"/>this child is that
defined for that namespace.
</p>
<p>The fo:instream-foreign-object flow object may have additional attributes
in the non-XSL namespace. These,
<spot id="c19i1"/>as well as the xsl defined properties,
are made available to the processor
of the content of the flow object. Their semantics is defined by that
namespace.
</p>

<p><emph>The following properties apply to this formatting object:</emph></p><slist>
<sitem><specref ref="common-accessibility-properties"/></sitem>
<sitem><specref ref="common-aural-properties"/></sitem>
<sitem><specref ref="common-border-padding-and-background-properties"/></sitem>

<sitem><specref ref="common-margin-properties-inline"/></sitem>
<sitem><specref ref="common-relative-position-properties"/></sitem>
<sitem><specref ref="alignment-adjust"/></sitem>
<sitem><specref ref="alignment-baseline"/></sitem>
<sitem><specref ref="baseline-shift"/></sitem>
<sitem><specref ref="block-progression-dimension"/></sitem>
<sitem><specref ref="clip"/></sitem>
<sitem><specref ref="content-height"/></sitem>
<sitem><specref ref="content-type"/></sitem>
<sitem><specref ref="content-width"/></sitem>
<sitem><specref ref="display-align"/></sitem>
<sitem><specref ref="dominant-baseline"/></sitem>
<sitem><specref ref="height"/></sitem>
<sitem><specref ref="id"/></sitem>
<sitem><specref ref="inline-progression-dimension"/></sitem>
<sitem><specref ref="keep-with-next"/></sitem>
<sitem><specref ref="keep-with-previous"/></sitem>
<sitem><specref ref="line-height"/></sitem>
<sitem><specref ref="overflow"/></sitem>
<sitem><specref ref="scaling"/></sitem>
<sitem><specref ref="scaling-method"/></sitem>
<sitem><specref ref="text-align"/></sitem>

<sitem><specref ref="width"/></sitem>
</slist>
</div3>


<div3 id="fo_inline"><head>fo:inline</head>

<p><emph>Common Usage:</emph></p>
<p>The fo:inline formatting object is commonly used for formatting
a portion of text with a background or enclosing it in a border.
</p>

<p><emph>Areas:</emph></p>
<p>The fo:inline formatting object generates one or more
<term>normal</term> <term>inline-area</term>s.
The fo:inline returns these areas, any
<term>page-level-out-of-line</term> areas, and
any <term>reference-level-out-of-line</term> areas
returned by the children of the fo:inline.</p>

<p><emph>Constraints:</emph></p>
<p>No area may have more than one normal child area
returned by the same fo:inline formatting object.</p>
<p>The children of each normal area returned by an fo:inline
must satisfy the constraints specified in <specref ref="area-inlinebuild"/>.
</p>
<p>In addition the constraints imposed by the traits derived from the
properties applicable to this formatting object must be satisfied.
The geometric constraints are rigorously defined in <specref ref="area_model"/>.</p>

<p><emph>Contents:</emph></p>
<eg xml:space="preserve">
(#PCDATA|<loc href="#inline.fo.list" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">%inline;</loc>|<loc href="#block.fo.list" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">%block;</loc>)*
</eg>

<p><spot id="fo0001_16b"/>In addition this formatting object may have a sequence of
zero or more fo:markers as its initial children.</p>
<p>An fo:inline that is a child of an fo:footnote may not have
block-level children.
An fo:inline that is a descendant <spot id="jm010109_50"/>of an fo:leader or of the
fo:inline child of an fo:footnote
may not have block-level children, unless it has a nearer ancestor that
is an fo:inline-container.</p>

<p><emph>The following properties apply to this formatting object:</emph></p><slist>
<sitem><specref ref="common-accessibility-properties"/></sitem>
<sitem><specref ref="common-aural-properties"/></sitem>
<sitem><specref ref="common-border-padding-and-background-properties"/></sitem>
<sitem><specref ref="common-font-properties"/></sitem>
<sitem><specref ref="common-margin-properties-inline"/></sitem>
<sitem><specref ref="common-relative-position-properties"/></sitem>
<sitem><specref ref="alignment-adjust"/></sitem>
<sitem><specref ref="alignment-baseline"/></sitem>
<sitem><specref ref="baseline-shift"/></sitem>
<sitem><specref ref="block-progression-dimension"/></sitem>
<sitem><specref ref="color"/></sitem>
<sitem><specref ref="dominant-baseline"/></sitem>
<sitem><specref ref="height"/></sitem>
<sitem><specref ref="id"/></sitem>
<sitem><specref ref="inline-progression-dimension"/></sitem>
<sitem><specref ref="keep-together"/></sitem>
<sitem><specref ref="keep-with-next"/></sitem>
<sitem><specref ref="keep-with-previous"/></sitem>
<sitem><specref ref="line-height"/></sitem>
<sitem><specref ref="text-decoration"/></sitem>
<sitem><specref ref="visibility"/></sitem>
<sitem><specref ref="width"/></sitem>
<sitem><specref ref="wrap-option"/></sitem>
</slist>
</div3>


<div3 id="fo_inline-container"><head>fo:inline-container</head>

<p><emph>Common Usage:</emph></p>
<p>The fo:inline-container flow object is used to
generate an inline reference-area, typically containing
text blocks with a different writing-mode.
</p>
<note><p>The use of this flow object is not required for
bi-directional text;
in this case the Unicode <spot id="jm010109_11w"/>BIDI
algorithm and the fo:bidi-override are sufficient.</p>
</note>

<p><emph>Areas:</emph></p>
<p>The fo:inline-container formatting object generates one or more
<term>viewport/reference pair</term>s. The viewport-areas generated
by the fo:inline-container are
<term>normal</term> <term>inline-level</term> areas that
use the <term>large-allocation-rectangle</term>
as defined in <specref ref="area-geo"/>.
The fo:inline-container returns these areas and any
<term>page-level-out-of-line</term> areas
returned by the children of the fo:inline-container.</p>

<p><emph>Trait Derivation:</emph></p>
<p>The areas generated by the fo:inline-container formatting object have
a value of "true" for the <trait>is-reference-area</trait>.</p>
<p>The size of the viewport-area and the reference-area has to
be fixed in the inline-progression-direction.
It must be specified
unless the inline-progression-direction is parallel to the
inline-progression-direction of the reference-area into
which
the areas generated by this flow object are placed.</p>
<p><spot id="aj000031_1"/>The values in the baseline-table of
this object are calculated as follows:</p>
<glist>
<gitem><label>baseline</label>
<def><p>If the writing mode has a block-progression-direction that
is parallel to the block-progression-direction of the parent:
the alignment-point is at the position of the dominant-baseline
of the first descendant line-area. If there is no such line-area
the alignment-point is at the position of the after-edge of the allocation rectangle.
</p>
<p>If the writing mode has a block-progression-direction that
is not parallel to the block-progression-direction of the parent:
the alignment-point is at the position that is half way between
the before-edge and after-edge of the content rectangle.
</p>
</def>
</gitem>
<gitem><label>before-edge</label>
<def><p>The alignment-point is at the position of the before-edge of
the allocation rectangle.
</p>
</def>
</gitem>
<gitem><label>text-before-edge</label>
<def><p>The alignment-point is at the position that is the closest
to the before-edge of the allocation rectangle selected from the
two candidate edges.
If the writing mode has a block-progression-direction that
is parallel to the block-progression-direction of the parent
the candidate edges are the before-edge and
the after-edge of the content rectangle; if it is not, the candidate
edges are the start-edge and the end-edge of the content rectangle.
</p>
</def>
</gitem>
<gitem><label>middle</label>
<def><p>The alignment-point is at the position that is half way between
the before-edge and after-edge of the allocation rectangle.
</p>
</def>
</gitem>
<gitem><label>after-edge</label>
<def><p>The alignment-point is at the position of the after-edge of
the allocation rectangle.
</p>
</def>
</gitem>
<gitem><label>text-after-edge</label>
<def><p>The alignment-point is at the position that is the closest
to the after-edge of the allocation rectangle selected from the
two candidate edges.
If the writing mode has a block-progression-direction that
is parallel to the block-progression-direction of the parent
the candidate edges are the before-edge and
the after-edge of the content rectangle; if it is not, the candidate
edges are the start-edge and the end-edge of the content rectangle.
</p>
</def>
</gitem>
<gitem><label>ideographic</label>
<def><p>The alignment-point is at the position that is
7/10 of the distance from the before-edge of the allocation rectangle
to the after-edge of the allocation rectangle.
</p>
</def>
</gitem>
<gitem><label>alphabetic</label>
<def><p>The alignment-point is at the position that is
6/10 of the distance from the before-edge of the allocation rectangle
to the after-edge of the allocation rectangle.
</p>
</def>
</gitem>
<gitem><label>hanging</label>
<def><p>The alignment-point is at the position that is
2/10 of the distance from the before-edge of the allocation rectangle
to the after-edge of the allocation rectangle.
</p>
</def>
</gitem>
<gitem><label>mathematical</label>
<def><p>The alignment-point is at the position that is
5/10 of the distance from the before-edge of the allocation rectangle
to the after-edge of the allocation rectangle.
</p>
</def>
</gitem>
</glist>

<p><emph>Constraints:</emph></p>
<p>No area may have more than one normal child area
returned by the same fo:inline-container formatting object.</p>
<p>The children of each reference-area generated by an fo:inline-container
formatting object
must be normal <term>block-area</term>s returned by the children of the fo:inline-container,
must be <term>properly stacked</term>, and
must be <term>properly ordered</term>.
</p>
<p>Any <term>reference-level-out-of-line</term>
areas returned by the children of the fo:inline-container
are handled as described in <specref ref="fo_float"/>.</p>

<p><emph>Contents:</emph></p>
<eg xml:space="preserve">
(<loc href="#block.fo.list" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">%block;</loc>)+
</eg>

<p>In addition this formatting object may have a sequence of
zero or more fo:markers as its initial children.</p>

<p><emph>The following properties apply to this formatting object:</emph></p><slist>
<sitem><specref ref="common-border-padding-and-background-properties"/></sitem>

<sitem><specref ref="common-margin-properties-inline"/></sitem>
<sitem><specref ref="common-relative-position-properties"/></sitem>
<sitem><specref ref="alignment-adjust"/></sitem>
<sitem><specref ref="alignment-baseline"/></sitem>
<sitem><specref ref="baseline-shift"/></sitem>
<sitem><specref ref="block-progression-dimension"/></sitem>
<sitem><specref ref="clip"/></sitem>
<sitem><specref ref="display-align"/></sitem>
<sitem><specref ref="dominant-baseline"/></sitem>
<sitem><specref ref="height"/></sitem>
<sitem><specref ref="id"/></sitem>
<sitem><specref ref="inline-progression-dimension"/></sitem>
<sitem><specref ref="keep-together"/></sitem>
<sitem><specref ref="keep-with-next"/></sitem>
<sitem><specref ref="keep-with-previous"/></sitem>
<sitem><specref ref="line-height"/></sitem>
<sitem><specref ref="overflow"/></sitem>
<sitem><specref ref="reference-orientation"/></sitem>

<sitem><specref ref="width"/></sitem>
<sitem><specref ref="writing-mode"/></sitem>
</slist>
</div3>


<div3 id="fo_leader"><head>fo:leader</head>

<p><emph>Common Usage:</emph></p>
<p>The fo:leader formatting object is often used:</p>
<ulist><item><p>in table-of-contents
to generate sequences of "." glyphs that separate
titles from page numbers</p></item>
<item><p>to create entry fields in fill-in-the-blank forms</p></item>
<item><p>to create horizontal rules for use as separators</p></item></ulist>

<p><emph>Areas:</emph></p>
<p>The fo:leader formatting object generates and returns
a single normal <term>inline-area</term>.</p>

<p><emph>Trait Derivation:</emph></p>
<p>If the value of the <trait>leader-pattern</trait> is "use-content"
the <trait>block-progression-dimension</trait> of the content-rectangle is determined
in the same manner as for line-areas; otherwise it is determined by
the <trait>rule-thickness</trait> trait.</p>

<p><emph>Constraints:</emph></p>
<p>If the leader's minimum length is too long to place in the
line-area, the leader will begin a new line. If it is too long to be
placed in a line by itself, it will overflow the line and potentially
overflow the reference-area in accordance with that container's
<trait>overflow</trait> trait.</p>
<p>The fo:leader formatting object can have any inline formatting objects and
characters as its children, except that fo:leaders may not be nested.
Its children
are ignored unless the value of the <trait>leader-pattern</trait> trait is "use-content".</p>
<note><p>If the value of the <trait>leader-pattern</trait> trait is "use-content"
and the fo:leader has no children, the leader shall be filled with
blank space.</p></note>
<p>The inline-area generated by the fo:leader has a dimension in the
inline-progression-direction which shall be at least the
<trait>leader-length.minimum</trait> and at most the
<trait>leader-length.maximum</trait>.</p>
<p>For lines-areas that have been specified to be justified, the justified
line-area must honor the <trait>leader-alignment</trait> trait of any inline-areas
generated by fo:leaders.</p>
<p>If the value of the <trait>leader-pattern</trait> trait is "dots" or "use-content",
the following constraint applies:</p>
<p>
The inline-area generated by the fo:leader has as its children the areas
returned by children of the fo:leader, or obtained by formatting the pattern
specified in the <trait>leader-pattern</trait> trait, repeated an integral number of
times.  If the width of even a single repetition is larger than the dimension
of the inline-area in the inline-progression-direction, the inline-area shall
be filled with blank space.  The space-start and space-end of the child areas
is set to account for the constraints specified in the
<trait>leader-pattern-width</trait>
and <trait>leader-alignment</trait> traits.<spot id="fo0001_9a"/></p>
<note><p>If it is desired that the leader should stretch to fill all available space
on a line, the maximum length of the leader should be specified to be at least as
large as the column width.</p></note>
<note><p>The alignment of the leader may be script specific and may require indicating
what alignment point is required, because it is different from the default alignment for
the script.  For example, in some usage of Indic scripts the leader is aligned at the
alphabetic baseline.</p></note>
<note><p>An fo:leader can be wrapped in an fo:block, yielding a block-area
with a line-area containing the leader,
to create a rule for separating
or decorating block-areas.</p></note>

<p><emph>Contents:</emph></p>
<eg xml:space="preserve">
(#PCDATA|<loc href="#inline.fo.list" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">%inline;</loc>)*
</eg>

<p>The content must not contain an fo:leader, fo:inline-container,
<spot id="fo0001_16ab"/>fo:block-container,
fo:float, fo:footnote, or fo:marker
either as a direct child or as a descendant.</p>

<p><emph>The following properties apply to this formatting object:</emph></p><slist>
<sitem><specref ref="common-accessibility-properties"/></sitem>
<sitem><specref ref="common-aural-properties"/></sitem>
<sitem><specref ref="common-border-padding-and-background-properties"/></sitem>
<sitem><specref ref="common-font-properties"/></sitem>
<sitem><specref ref="common-margin-properties-inline"/></sitem>
<sitem><specref ref="common-relative-position-properties"/></sitem>
<sitem><specref ref="alignment-adjust"/></sitem>
<sitem><specref ref="alignment-baseline"/></sitem>
<sitem><specref ref="baseline-shift"/></sitem>
<sitem><specref ref="color"/></sitem>
<sitem><specref ref="dominant-baseline"/></sitem>
<sitem><specref ref="text-depth"/></sitem>
<sitem><specref ref="text-altitude"/></sitem>
<sitem><specref ref="id"/></sitem>
<sitem><specref ref="keep-with-next"/></sitem>
<sitem><specref ref="keep-with-previous"/></sitem>
<sitem><specref ref="leader-alignment"/></sitem>
<sitem><specref ref="leader-length"/></sitem>
<sitem><specref ref="leader-pattern"/></sitem>
<sitem><specref ref="leader-pattern-width"/></sitem>
<sitem><specref ref="rule-style"/></sitem>
<sitem><specref ref="rule-thickness"/></sitem>
<sitem><specref ref="letter-spacing"/></sitem>
<sitem><specref ref="line-height"/></sitem>
<sitem><specref ref="text-shadow"/></sitem>
<sitem><specref ref="visibility"/></sitem>
<sitem><specref ref="word-spacing"/></sitem>
</slist>
</div3>



<div3 id="fo_page-number"><head>fo:page-number</head>

<p><emph>Common Usage:</emph></p>
<p>The fo:page-number formatting object is used to obtain an
inline-area
whose content is
the page-number for the page on which the inline-area is
placed.</p>

<p><emph>Areas:</emph></p>
<p>The fo:page-number formatting object generates and returns
a single normal <term>inline-area</term>.</p>

<p><emph>Constraints:</emph></p>
<p>The child areas of this inline-area are the same as the result of
formatting a result-tree fragment consisting of fo:character flow
objects; one for each character in the page-number string and
with only the "character" property specified.</p>
<p>The page-number string is obtained by converting the page-number
for the page
on which the inline-area is placed in accordance with the
number to string conversion properties of the ancestor
fo:page-sequence.</p>
<note><p>The conversion properties are:
<specref ref="format"/>,
<specref ref="grouping-separator"/>,
<specref ref="grouping-size"/>,
<specref ref="letter-value"/>,
<specref ref="country"/>, and
<specref ref="language"/>.
</p>
</note>

<p><emph>Contents:</emph></p>
<eg xml:space="preserve">
EMPTY
</eg>

<p><emph>The following properties apply to this formatting object:</emph></p><slist>
<sitem><specref ref="common-accessibility-properties"/></sitem>
<sitem><specref ref="common-aural-properties"/></sitem>
<sitem><specref ref="common-border-padding-and-background-properties"/></sitem>
<sitem><specref ref="common-font-properties"/></sitem>

<sitem><specref ref="common-margin-properties-inline"/></sitem>
<sitem><specref ref="common-relative-position-properties"/></sitem>
<sitem><specref ref="alignment-adjust"/></sitem>
<sitem><specref ref="alignment-baseline"/></sitem>
<sitem><specref ref="baseline-shift"/></sitem>
<sitem><specref ref="dominant-baseline"/></sitem>
<sitem><specref ref="id"/></sitem>
<sitem><specref ref="keep-with-next"/></sitem>
<sitem><specref ref="keep-with-previous"/></sitem>
<sitem><specref ref="letter-spacing"/></sitem>
<sitem><specref ref="line-height"/></sitem>
<sitem><specref ref="score-spaces"/></sitem>
<sitem><specref ref="text-altitude"/></sitem>
<sitem><specref ref="text-decoration"/></sitem>
<sitem><specref ref="text-depth"/></sitem>
<sitem><specref ref="text-shadow"/></sitem>
<sitem><specref ref="text-transform"/></sitem>

<sitem><specref ref="visibility"/></sitem>
<sitem><specref ref="word-spacing"/></sitem>
<sitem><specref ref="wrap-option"/></sitem>
</slist>
</div3>


<div3 id="fo_page-number-citation"><head>fo:page-number-citation</head>

<p><emph>Common Usage:</emph></p>
<p>The fo:page-number-citation is used to reference the
page-number for the page containing the first <term>normal</term>
area returned by the cited formatting
object.</p>
<note>
<p>It may be used to provide the page-numbers in the table of contents,
cross-references, and index entries.</p>
</note>

<p><emph>Areas:</emph></p>
<p>The fo:page-number-citation formatting object generates and returns
a single normal <term>inline-area</term>.</p>

<p><emph>Constraints:</emph></p>
<p>The <term>cited page-number</term> is the number of the page containing,
as a descendant, the
first normal area returned by the formatting object with
an <trait>id</trait> trait matching the <trait>ref-id</trait> trait
of the fo:page-number-citation (the referenced formatting object).</p>
<p>The <term>cited page-number string</term> is obtained by converting the
cited page-number in accordance with the
number to string conversion properties of the ancestor
fo:page-sequence of the referenced formatting object.</p>
<note><p>The conversion properties are:
<specref ref="format"/>,
<specref ref="grouping-separator"/>,
<specref ref="grouping-size"/>,
<specref ref="letter-value"/>,
<specref ref="country"/>, and
<specref ref="language"/>.
</p>
</note>
<p>The child areas of the generated inline-area are the same as the result of
formatting a result-tree fragment consisting of fo:character flow
objects; one for each character in the cited page-number string and
with only the "character" property specified.</p>

<p><emph>Contents:</emph></p>
<eg xml:space="preserve">
EMPTY
</eg>

<p><emph>The following properties apply to this formatting object:</emph></p><slist>
<sitem><specref ref="common-accessibility-properties"/></sitem>
<sitem><specref ref="common-aural-properties"/></sitem>
<sitem><specref ref="common-border-padding-and-background-properties"/></sitem>
<sitem><specref ref="common-font-properties"/></sitem>

<sitem><specref ref="common-margin-properties-inline"/></sitem>
<sitem><specref ref="common-relative-position-properties"/></sitem>
<sitem><specref ref="alignment-adjust"/></sitem>
<sitem><specref ref="alignment-baseline"/></sitem>
<sitem><specref ref="baseline-shift"/></sitem>
<sitem><specref ref="dominant-baseline"/></sitem>
<sitem><specref ref="id"/></sitem>
<sitem><specref ref="keep-with-next"/></sitem>
<sitem><specref ref="keep-with-previous"/></sitem>
<sitem><specref ref="letter-spacing"/></sitem>
<sitem><specref ref="line-height"/></sitem>
<sitem><specref ref="ref-id"/></sitem>
<sitem><specref ref="score-spaces"/></sitem>
<sitem><specref ref="text-altitude"/></sitem>
<sitem><specref ref="text-decoration"/></sitem>
<sitem><specref ref="text-depth"/></sitem>
<sitem><specref ref="text-shadow"/></sitem>
<sitem><specref ref="text-transform"/></sitem>

<sitem><specref ref="visibility"/></sitem>
<sitem><specref ref="word-spacing"/></sitem>
<sitem><specref ref="wrap-option"/></sitem>
</slist>
</div3>


</div2>

<div2>
<head>Formatting Objects for Tables</head>

<div3><head>Introduction</head>
<p>There are nine formatting objects used to construct tables:
fo:table-and-caption,
fo:table,
fo:table-column,
fo:table-caption,
fo:table-header,
fo:table-footer,
fo:table-body,
fo:table-row, and
fo:table-cell.
The result tree structure is shown below.
</p>
<figure>
<graphic source="TableTree.gif" alt="Tree representation of the Formatting Objects for tables" longdesc="A tree representation of table Formatting Objects showing how they fit within one another." xml:attributes="href source" show="embed" actuate="auto" xmlns:xlink="http://www.w3.org/TR/WD-xlink"/>
<figcap><p>Tree Representation of the Formatting Objects for Tables</p></figcap>
</figure>

<div4><head>Examples</head>
<div5><head>Simple Table, Centered and Indented</head>
<p><spot id="jm010029_i3"/>Input sample:</p>
<eg xml:space="preserve">
&lt;doc&gt;
&lt;table&gt;
&lt;caption&gt;&lt;p&gt;Caption for this table&lt;/p&gt;&lt;/caption&gt;
&lt;tgroup cols="3" width="325pt"&gt;
&lt;colspec colwidth="100pt"/&gt;
&lt;colspec colwidth="150pt"/&gt;
&lt;colspec colwidth="75pt"/&gt;
&lt;tbody&gt;
&lt;row&gt;
&lt;entry&gt;&lt;p&gt;Cell 1&lt;/p&gt;&lt;/entry&gt;
&lt;entry&gt;&lt;p&gt;Cell 2&lt;/p&gt;&lt;/entry&gt;
&lt;entry&gt;&lt;p&gt;Cell 3&lt;/p&gt;&lt;/entry&gt;
&lt;/row&gt;
&lt;/tbody&gt;
&lt;/tgroup&gt;
&lt;/table&gt;
&lt;/doc&gt;
</eg>
<p>The table and its caption is centered in the available space
between the following indents: start-indent="100pt" and end-indent="0pt".
The centering and indent is not desired for the content of the caption
and the cells.
</p>
<p>XSL Stylesheet:</p>
<eg xml:space="preserve">
&lt;?xml version='1.0'?&gt;
&lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:fo="http://www.w3.org/1999/XSL/Format"
                version='1.0'&gt;

&lt;xsl:attribute-set name="inside-table"&gt;
  &lt;xsl:attribute name="start-indent"&gt;0pt&lt;/xsl:attribute&gt;
  &lt;xsl:attribute name="text-align"&gt;start&lt;/xsl:attribute&gt;
&lt;/xsl:attribute-set&gt;

&lt;xsl:template match="p"&gt;
  &lt;fo:block&gt;
    &lt;xsl:apply-templates/&gt;
  &lt;/fo:block&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match="table"&gt;
  &lt;fo:table-and-caption text-align="center" start-indent="100pt"&gt;
    &lt;xsl:apply-templates/&gt;
  &lt;/fo:table-and-caption&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match="caption"&gt;
  &lt;fo:table-caption xsl:use-attribute-sets="inside-table"&gt;
    &lt;xsl:apply-templates/&gt;
  &lt;/fo:table-caption&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match="tgroup"&gt;
  &lt;fo:table width="{@width}" table-layout="fixed"&gt;
    &lt;xsl:apply-templates/&gt;
  &lt;/fo:table&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match="colspec"&gt;
  &lt;fo:table-column column-width="{@colwidth}"&gt;
    &lt;xsl:attribute name="column-number"&gt;
      &lt;xsl:number count="colspec"/&gt;
    &lt;/xsl:attribute&gt;
  &lt;/fo:table-column&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match="tbody"&gt;
  &lt;fo:table-body xsl:use-attribute-sets="inside-table"&gt;
    &lt;xsl:apply-templates/&gt;
  &lt;/fo:table-body&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match="row"&gt;
  &lt;fo:table-row&gt;
    &lt;xsl:apply-templates/&gt;
  &lt;/fo:table-row&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match="entry"&gt;
  &lt;fo:table-cell&gt;
    &lt;xsl:apply-templates/&gt;
  &lt;/fo:table-cell&gt;
&lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;
</eg>
<p>Result Instance: elements and attributes in the fo:
namespace</p>
<eg xml:space="preserve">
&lt;fo:table-and-caption text-align="center" start-indent="100pt"&gt;

  &lt;fo:table-caption start-indent="0pt" text-align="start"&gt;
    &lt;fo:block&gt;Caption for this table
    &lt;/fo:block&gt;
  &lt;/fo:table-caption&gt;

  &lt;fo:table width="325pt" table-layout="fixed"&gt;

    &lt;fo:table-column column-width="100pt" column-number="1"&gt;
    &lt;/fo:table-column&gt;
    &lt;fo:table-column column-width="150pt" column-number="2"&gt;
    &lt;/fo:table-column&gt;
    &lt;fo:table-column column-width="75pt" column-number="3"&gt;
    &lt;/fo:table-column&gt;

    &lt;fo:table-body start-indent="0pt" text-align="start"&gt;

    &lt;fo:table-row&gt;

    &lt;fo:table-cell&gt;
    &lt;fo:block&gt;Cell 1
    &lt;/fo:block&gt;
    &lt;/fo:table-cell&gt;
    &lt;fo:table-cell&gt;
    &lt;fo:block&gt;Cell 2
    &lt;/fo:block&gt;
    &lt;/fo:table-cell&gt;
    &lt;fo:table-cell&gt;
    &lt;fo:block&gt;Cell 3
    &lt;/fo:block&gt;
    &lt;/fo:table-cell&gt;

    &lt;/fo:table-row&gt;

    &lt;/fo:table-body&gt;

  &lt;/fo:table&gt;

&lt;/fo:table-and-caption&gt;
</eg>
</div5>

<div5><head>Simple Table with Relative Column-width Specifications</head>
<p>This example is using a simple, "Oasis-table-model-like", markup for the
table elements. The column-widths are <spot id="jm010109_51"/>specified using full
relative column-width specification.</p>
<p>Input sample:</p>
<eg xml:space="preserve">
&lt;doc&gt;
&lt;table&gt;
&lt;tgroup cols="3"&gt;
&lt;colspec colname="col1" colwidth="1*"/&gt;
&lt;colspec colname="col2" colwidth="2*+2pi"/&gt;
&lt;colspec colname="col3" colwidth="72"/&gt;
&lt;tbody&gt;
&lt;row&gt;
&lt;entry colnum="1" valign="top"&gt;&lt;p&gt;Cell 1&lt;/p&gt;&lt;/entry&gt;
&lt;entry colnum="2" valign="middle" align="center"&gt;&lt;p&gt;Cell 2&lt;/p&gt;&lt;/entry&gt;
&lt;entry colnum="3" align="center"&gt;&lt;p&gt;Cell 3&lt;/p&gt;&lt;/entry&gt;
&lt;/row&gt;
&lt;/tbody&gt;
&lt;/tgroup&gt;
&lt;/table&gt;
&lt;/doc&gt;
</eg>
<p>XSL Stylesheet:</p>
<eg xml:space="preserve">
&lt;?xml version='1.0'?&gt;
&lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:fo="http://www.w3.org/1999/XSL/Format"
                version='1.0'&gt;

&lt;xsl:template match="p"&gt;
  &lt;fo:block&gt;
    &lt;xsl:apply-templates/&gt;
  &lt;/fo:block&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match="table"&gt;
  &lt;fo:table width="12cm" table-layout="fixed"&gt;
    &lt;xsl:apply-templates/&gt;
  &lt;/fo:table&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match="colspec"&gt;
  &lt;fo:table-column&gt;
    &lt;xsl:attribute name="column-number"&gt;
      &lt;xsl:number count="colspec"/&gt;
    &lt;/xsl:attribute&gt;
    &lt;xsl:attribute name="column-width"&gt;
      &lt;xsl:call-template name="calc.column.width"&gt;
        &lt;xsl:with-param name="colwidth"&gt;
          &lt;xsl:value-of select="@colwidth"/&gt;
        &lt;/xsl:with-param&gt;
      &lt;/xsl:call-template&gt;
    &lt;/xsl:attribute&gt;
  &lt;/fo:table-column&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match="tbody"&gt;
  &lt;fo:table-body&gt;
    &lt;xsl:apply-templates/&gt;
  &lt;/fo:table-body&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match="row"&gt;
  &lt;fo:table-row&gt;
    &lt;xsl:apply-templates/&gt;
  &lt;/fo:table-row&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match="entry"&gt;
  &lt;fo:table-cell column-number="{@colnum}"&gt;
    &lt;xsl:if test="@valign"&gt;
      &lt;xsl:choose&gt;
        &lt;xsl:when test="@valign='middle'"&gt;
          &lt;xsl:attribute name="display-align"&gt;center&lt;/xsl:attribute&gt;
        &lt;/xsl:when&gt;
        &lt;xsl:otherwise&gt;
          &lt;xsl:attribute name="display-align"&gt;
            &lt;xsl:value-of select="@valign"/&gt;
          &lt;/xsl:attribute&gt;
        &lt;/xsl:otherwise&gt;
      &lt;/xsl:choose&gt;
    &lt;/xsl:if&gt;
    &lt;xsl:if test="@align"&gt;
      &lt;xsl:attribute name="text-align"&gt;
        &lt;xsl:value-of select="@align"/&gt;
      &lt;/xsl:attribute&gt;
    &lt;/xsl:if&gt;
    &lt;xsl:apply-templates/&gt;
  &lt;/fo:table-cell&gt;
&lt;/xsl:template&gt;


&lt;xsl:template name="calc.column.width"&gt;
&lt;!-- **
     * &lt;p&gt;Calculate an XSL FO table column-width specification from a
     * full relative table column-width specification.&lt;/p&gt;
     *
     * &lt;p&gt;Table column-widths are in the following basic
     * forms:&lt;/p&gt;
     *
     * &lt;ul&gt;
     * &lt;li&gt;&lt;b&gt;99.99units&lt;/b&gt;, a fixed length-specifier.&lt;/li&gt;
     * &lt;li&gt;&lt;b&gt;99.99&lt;/b&gt;, a fixed length-specifier without any units.&lt;/li&gt;
     * &lt;li&gt;&lt;b&gt;99.99*&lt;/b&gt;, a relative length-specifier.&lt;/li&gt;
     * &lt;li&gt;&lt;b&gt;99.99*+99.99units&lt;/b&gt;, a combination of both.&lt;/li&gt;
     * &lt;/ul&gt;
     *
     * &lt;p&gt;The units are points (pt), picas (pi), centimeters (cm),
     * millimeters (mm), and inches (in). These are the same units as XSL,
     * except that XSL abbreviates picas "pc" instead of "pi". If a length
     * specifier has no units, the default unit (pt) is assumed.&lt;/p&gt;
     *
     * &lt;p&gt;Relative length-specifiers are represented in XSL with the
     * proportional-column-width() function.&lt;/p&gt;
     *
     * &lt;p&gt;Here are some examples:&lt;/p&gt;
     *
     * &lt;ul&gt;
     * &lt;li&gt;"36pt" becomes "36pt"&lt;/li&gt;
     * &lt;li&gt;"3pi" becomes "3pc"&lt;/li&gt;
     * &lt;li&gt;"36" becomes "36pt"&lt;/li&gt;
     * &lt;li&gt;"3*" becomes "proportional-column-width(3)"&lt;/li&gt;
     * &lt;li&gt;"3*+2pi" becomes "proportional-column-width(3)+2pc"&lt;/li&gt;
     * &lt;li&gt;"1*+2" becomes "proportional-column-width(1)+2pt"&lt;/li&gt;
     * &lt;/ul&gt;
     *
     * @param colwidth The column width specification.
     *
     * @returns The XSL column width specification.
     * --&gt;
  &lt;xsl:param name="colwidth"&gt;1*&lt;/xsl:param&gt;

  &lt;!-- Ok, the colwidth could have any one of the following forms: --&gt;
  &lt;!--        1*       = proportional width --&gt;
  &lt;!--     1unit       = 1.0 units wide --&gt;
  &lt;!--         1       = 1pt wide --&gt;
  &lt;!--  1*+1unit       = proportional width + some fixed width --&gt;
  &lt;!--      1*+1       = proportional width + some fixed width --&gt;

  &lt;!-- If it has a proportional width, translate it to XSL --&gt;
  &lt;xsl:if test="contains($colwidth, '*')"&gt;
    &lt;xsl:text&gt;proportional-column-width(&lt;/xsl:text&gt;
    &lt;xsl:value-of select="substring-before($colwidth, '*')"/&gt;
    &lt;xsl:text&gt;)&lt;/xsl:text&gt;
  &lt;/xsl:if&gt;

  &lt;!-- Now get the non-proportional part of the specification --&gt;
  &lt;xsl:variable name="width-units"&gt;
    &lt;xsl:choose&gt;
      &lt;xsl:when test="contains($colwidth, '*')"&gt;
        &lt;xsl:value-of
             select="normalize-space(substring-after($colwidth, '*'))"/&gt;
      &lt;/xsl:when&gt;
      &lt;xsl:otherwise&gt;
        &lt;xsl:value-of select="normalize-space($colwidth)"/&gt;
      &lt;/xsl:otherwise&gt;
    &lt;/xsl:choose&gt;
  &lt;/xsl:variable&gt;

  &lt;!-- Now the width-units could have any one of the following forms: --&gt;
  &lt;!--                 = &lt;empty string&gt; --&gt;
  &lt;!--     1unit       = 1.0 units wide --&gt;
  &lt;!--         1       = 1pt wide --&gt;
  &lt;!-- with an optional leading sign --&gt;

  &lt;!-- Get the width part by blanking out the units part and discarding --&gt;
  &lt;!-- white space. --&gt;
  &lt;xsl:variable name="width"
       select="normalize-space(translate($width-units,
                                         '+-0123456789.abcdefghijklmnopqrstuvwxyz',
                                         '+-0123456789.'))"/&gt;

  &lt;!-- Get the units part by blanking out the width part and discarding --&gt;
  &lt;!-- white space. --&gt;
  &lt;xsl:variable name="units"
       select="normalize-space(translate($width-units,
                                         'abcdefghijklmnopqrstuvwxyz+-0123456789.',
                                         'abcdefghijklmnopqrstuvwxyz'))"/&gt;

  &lt;!-- Output the width --&gt;
  &lt;xsl:value-of select="$width"/&gt;

  &lt;!-- Output the units, translated appropriately --&gt;
  &lt;xsl:choose&gt;
    &lt;xsl:when test="$units = 'pi'"&gt;pc&lt;/xsl:when&gt;
    &lt;xsl:when test="$units = '' and $width != ''"&gt;pt&lt;/xsl:when&gt;
    &lt;xsl:otherwise&gt;&lt;xsl:value-of select="$units"/&gt;&lt;/xsl:otherwise&gt;
  &lt;/xsl:choose&gt;
&lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;
</eg>
<p>Result Instance: elements and attributes in the fo:
namespace</p>
<eg xml:space="preserve">
&lt;fo:table width="12cm" table-layout="fixed"&gt;
  &lt;fo:table-column column-number="1" column-width="proportional-column-width(1)"&gt;
  &lt;/fo:table-column&gt;
  &lt;fo:table-column column-number="2" column-width="proportional-column-width(2)+2pc"&gt;
  &lt;/fo:table-column&gt;
  &lt;fo:table-column column-number="3" column-width="72pt"&gt;
  &lt;/fo:table-column&gt;
  &lt;fo:table-body&gt;
    &lt;fo:table-row&gt;
      &lt;fo:table-cell column-number="1" display-align="top"&gt;
        &lt;fo:block&gt;Cell 1
        &lt;/fo:block&gt;
      &lt;/fo:table-cell&gt;
      &lt;fo:table-cell column-number="2" display-align="center" text-align="center"&gt;
        &lt;fo:block&gt;Cell 2
        &lt;/fo:block&gt;
      &lt;/fo:table-cell&gt;
      &lt;fo:table-cell column-number="3" text-align="center"&gt;
        &lt;fo:block&gt;Cell 3
        &lt;/fo:block&gt;
      &lt;/fo:table-cell&gt;
    &lt;/fo:table-row&gt;
  &lt;/fo:table-body&gt;
&lt;/fo:table&gt;
</eg>
</div5>
</div4>
</div3>


<div3 id="fo_table-and-caption"><head>fo:table-and-caption</head>

<p><emph>Common Usage:</emph></p>
<p>The fo:table-and-caption flow object is used for
formatting a table
together with its caption.</p>
<note><p>A fo:table-and-caption may be placed inline by enclosing
it in an fo:inline-container.</p>
</note>
<note>
<p>This formatting object corresponds to the CSS anonymous
box that encloses the table caption and the table.</p>
</note>

<p><emph>Areas:</emph></p>
<p>The fo:table-and-caption formatting object generates one or more
<term>normal</term> <term>block-area</term>s.
The fo:table-and-caption returns these areas, any
<term>page-level-out-of-line</term> areas, and
any <term>reference-level-out-of-line</term> areas
returned by the children of the fo:table-and-caption.</p>

<p><emph>Constraints:</emph></p>
<p>No area may have more than one normal child area
returned by the same fo:table-and-caption formatting object.</p>
<p>The children of the areas generated by the fo:table-and-caption
are one or two areas;
one for the table caption and one for the table itself.
These are positioned relative to each other as specified by the
<trait>caption-side</trait> trait.
They are placed relative to the content-rectangle of the generated area
as specified by the <trait>text-align</trait> trait.</p>

<p><emph>Contents:</emph></p>
<eg xml:space="preserve">
(<loc href="#fo_table-caption" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">table-caption</loc>?,<loc href="#fo_table" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">table</loc>)
</eg>

<p>In addition this formatting object may have a sequence of
zero or more fo:markers as its initial children.<spot id="fo_11b"/></p>

<p><emph>The following properties apply to this formatting object:</emph></p><slist>
<sitem><specref ref="common-accessibility-properties"/></sitem>
<sitem><specref ref="common-aural-properties"/></sitem>
<sitem><specref ref="common-border-padding-and-background-properties"/></sitem>
<sitem><specref ref="common-margin-properties-block"/></sitem>
<sitem><specref ref="common-relative-position-properties"/></sitem>
<sitem><specref ref="break-after"/></sitem>
<sitem><specref ref="break-before"/></sitem>
<sitem><specref ref="caption-side"/></sitem>
<sitem><specref ref="id"/></sitem>
<sitem><specref ref="intrusion-displace"/></sitem>
<sitem><specref ref="keep-together"/></sitem>
<sitem><specref ref="keep-with-next"/></sitem>
<sitem><specref ref="keep-with-previous"/></sitem>
<sitem><specref ref="text-align"/></sitem>
</slist>
</div3>


<div3 id="fo_table"><head>fo:table</head>

<p><emph>Common Usage:</emph></p>
<p>The fo:table flow object is used for formatting the
tabular material
of a table.</p>
<p>The fo:table flow object and its child flow objects
model the
visual layout of a table in a "row primary" manner. A complete table
may be seen as consisting of a grid of rows and columns where each
cell occupies one or more grid units in the row-progression-direction
and column-progression-direction.</p>
<p>The table content is divided into a header (optional), footer (optional),
and one or more bodies. Properties specify if the headers and footers
should be repeated at a break in the table. Each of these parts occupies
one or more rows in the table grid.</p>

<p><emph>Areas:</emph></p>
<p>The fo:table formatting object generates <spot id="c14i1_a"/>and
returns one or more
<term>normal</term> <term>block-area</term>s.
In addition the fo:table returns any
<term>page-level-out-of-line</term> areas, and
any <term>reference-level-out-of-line</term> areas
returned by the children of the fo:table.</p>
<p>The areas generated <spot id="c14i1_b"/>and returned by the fo:table formatting object have
as children:</p>
<ulist>
<item><p>Areas, with only background, corresponding to the
table-header, table-footer, table-body,
<spot id="no000005_1"/>spanned columns, columns, and rows.
</p>
<note><p>The spanned columns (fo:table-column with a "number-columns-spanned"
value greater than 1) are used in the same way as the "column groups"
in CSS2 for determining the background.</p>
</note>
</item>
<item><p>Areas returned by the fo:table-cell formatting objects.</p></item>
</ulist>
<p>These areas have a z-index controlling the rendering order
determined in accordance with 17.5.1 of the CSS2 specification
(<xspecref href="http://www.w3.org/TR/REC-CSS2/tables.html#table-layers" show="new" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">http://www.w3.org/TR/REC-CSS2/tables.html#table-layers"</xspecref>).</p>
<note><p>A cell that is spanned may have a different background in each
of the grid units it occupies.</p>
</note>

<p><emph>Trait Derivation:</emph></p>
<p>The areas generated <spot id="c14i1_c"/>and returned
by the fo:table formatting object have
a value of "true" for the <trait>is-reference-area</trait>.</p>
<p>The column-progression-direction and row-progression-direction are
determined by the <trait>writing-mode</trait> trait. Columns use the
inline-progression-direction, and
rows use the block-progression-direction.
</p>
<p>The method for deriving the border traits for a table is
specified by the "border-collapse" property.</p>
<p>If the value of the "border-collapse" property is
"separate" the border
is composed of two components. The first, which is placed
with the inside edge coincident with the outermost table grid boundary line,
has the width of half the value for the "border-separation" property.
It is filled in accordance with the "background" property of the fo:table.
Second, outside the outermost table grid boundary line
is placed, for each side of the table, a border based
on a border specified on the table.</p>
<p>If the value of the "border-collapse" property is "collapse"
or "collapse-with-precedence" the border
is determined, for each segment, at the cell level.</p>
<note><p>By specifying "collapse-with-precedence" and
an appropriately
high <spot id="aj000036_1a"/>precedence on the border
specification for the fo:table one may ensure that this specification
is the one used on all border segments.</p>
</note>

<p><emph>Constraints:</emph></p>
<p><spot id="fo0001_14a"/>No area may have more than one normal child area
returned by the same fo:table formatting object.</p>
<p>The inline-progression-dimension
of the content-rectangle of the table is the
sum of the inline-progression-dimensions
of the columns in the table grid. The method used to determine these
inline-progression-dimensions is governed by the values of
the <trait>table-layout</trait> and
the <trait>inline-progression-dimension</trait> traits in the following manner:</p>
<glist>
<gitem><label>inline-progression-dimension="auto" table-layout="auto"</label>
<def><p>The automatic table layout shall be used.</p></def>
</gitem>
<gitem><label>inline-progression-dimension="auto" table-layout="fixed"</label>
<def><p>The automatic table layout shall be used.</p></def>
</gitem>
<gitem><label>inline-progression-dimension=&lt;length&gt;
<spot id="aj000035_32a"/>or &lt;percentage&gt; table-layout="auto"</label>
<def><p>The automatic table layout shall be used.</p></def>
</gitem>
<gitem><label>inline-progression-dimension=&lt;length&gt;
<spot id="aj000035_32b"/>or &lt;percentage&gt; table-layout="fixed"</label>
<def><p>The fixed table layout shall be used.</p></def>
</gitem>
</glist>
<p>The automatic table layout and fixed table layout is defined in
17.5.2 of the CSS2 specification
(<xspecref href="http://www.w3.org/TR/REC-CSS2/tables.html#width-layout" show="new" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">http://www.w3.org/TR/REC-CSS2/tables.html#width-layout"</xspecref>).</p>
<p>The method for determining the block-progression-dimension
of the table is
governed by the <trait>block-progression-dimension</trait> trait.</p>
<note><p>The CSS2 specification explicitly does not specify
what the behavior
should be if there is a mismatch between an explicitly
specified table block-progression-dimension
and the block-progression-dimensions of the content.</p>
</note>
<note><p>The use of the "proportional-column-width()" function is only
permitted when the fixed table layout is used.</p>
<p><spot id="aj000035_32c"/>If the use of proportional column widths are
desired on a table of an unknown explicit width,
the inline-progression-dimension cannot be specified to be "auto".
Instead, the width must be specified as a percentage.
For example, setting table-layout="fixed" and
inline-progression-dimension="100%" would allow proportional
column widths while simultaneously creating a table as wide as
possible in the current context.</p>
</note>
<note><p><spot id="fo0001ab_bb"/>The result of using a percentage for
the width may be unpredictable, especially when using the
automatic table layout.
</p></note>
<p><spot id="fo_sg_07"/>It is an error if two table-cells overlap.</p>
<note><p>Such overlap could be due to the same column-number being
assigned to two different cells in the same row, or due to column or
row spanning causing an overlap.</p>
</note>

<p><emph>Contents:</emph></p>
<eg xml:space="preserve">
(<loc href="#fo_table-column" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">table-column</loc>*,<loc href="#fo_table-header" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">table-header</loc>?,<loc href="#fo_table-footer" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">table-footer</loc>?,<loc href="#fo_table-body" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">table-body</loc>+)
</eg>

<p>In addition this formatting object may have a sequence of
zero or more fo:markers as its initial children.</p>

<p><emph>The following properties apply to this formatting object:</emph></p><slist>
<sitem><specref ref="common-accessibility-properties"/></sitem>
<sitem><specref ref="common-aural-properties"/></sitem>
<sitem><specref ref="common-border-padding-and-background-properties"/></sitem>

<sitem><specref ref="common-margin-properties-block"/></sitem>
<sitem><specref ref="common-relative-position-properties"/></sitem>
<sitem><specref ref="block-progression-dimension"/></sitem>
<sitem><specref ref="border-after-precedence"/></sitem>
<sitem><specref ref="border-before-precedence"/></sitem>
<sitem><specref ref="border-collapse"/></sitem>
<sitem><specref ref="border-end-precedence"/></sitem>
<sitem><specref ref="border-separation"/></sitem>
<sitem><specref ref="border-start-precedence"/></sitem>
<sitem><specref ref="break-after"/></sitem>
<sitem><specref ref="break-before"/></sitem>
<sitem><specref ref="id"/></sitem>
<sitem><specref ref="inline-progression-dimension"/></sitem>
<sitem><specref ref="intrusion-displace"/></sitem>
<sitem><specref ref="height"/></sitem>
<sitem><specref ref="keep-together"/></sitem>
<sitem><specref ref="keep-with-next"/></sitem>
<sitem><specref ref="keep-with-previous"/></sitem>
<sitem><specref ref="table-layout"/></sitem>
<sitem><specref ref="table-omit-footer-at-break"/></sitem>
<sitem><specref ref="table-omit-header-at-break"/></sitem>
<sitem><specref ref="width"/></sitem>
<sitem><specref ref="writing-mode"/></sitem>
</slist>
</div3>


<div3 id="fo_table-column"><head>fo:table-column</head>

<p><emph>Common Usage:</emph></p>
<p>The fo:table-column auxiliary formatting object specifies
characteristics
applicable to table cells that have the same column and span.
The most important property is the "column-width" property.</p>

<p><emph>Areas:</emph></p>
<p>The fo:table-column formatting object does not generate
or return any areas.
It holds a set of traits that provide constraints on the
column widths and a specification of some presentation
characteristics, <spot id="c14i2_a"/>such as background which
affects the areas generated by the fo:table (see <specref ref="fo_table"/>).
Inheritable properties may also be specified on the fo:table-column.
These can be referenced by the from-table-column() function
in an expression.
</p>
<note><p><spot id="se010004_7"/>More details,
in particular the use of an fo:table-column with
number-columns-spanned greater than 1, are given in
the description of fo:table and of the from-table-column() function.
</p>
</note>

<p><emph>Constraints:</emph></p>
<p>None.</p>

<p><emph>Contents:</emph></p>
<eg xml:space="preserve">
EMPTY
</eg>

<p><emph>The following properties apply to this formatting object:</emph></p><slist>
<sitem><specref ref="common-border-padding-and-background-properties"/><prnote><p><spot id="c17i1_a"/>Only the background properties
from this set apply.
If the value of border-collapse is "collapse" or "collapse-with-precedence" for the table the
border properties also apply.</p>
</prnote></sitem>
<sitem><specref ref="border-after-precedence"/></sitem>
<sitem><specref ref="border-before-precedence"/></sitem>
<sitem><specref ref="border-end-precedence"/></sitem>
<sitem><specref ref="border-start-precedence"/></sitem>
<sitem><specref ref="column-number"/></sitem>
<sitem><specref ref="column-width"/></sitem>
<sitem><specref ref="number-columns-repeated"/></sitem>
<sitem><specref ref="number-columns-spanned"/></sitem>
<sitem><specref ref="visibility"/></sitem>
</slist>
</div3>


<div3 id="fo_table-caption"><head>fo:table-caption</head>

<p><emph>Common Usage:</emph></p>
<p><spot id="aj000035_24b"/>The fo:table-caption formatting object
is used to contain block-level formatting objects containing
the caption for the table only when using the fo:table-and-caption. </p>

<p><emph>Areas:</emph></p>
<p>The fo:table-caption formatting object generates one or more
<term>normal</term> <term>reference-area</term>s.
The fo:table-caption returns these reference-areas and any
<term>page-level-out-of-line</term> areas
returned by the children of the fo:table-caption.</p>

<p><emph>Trait Derivation:</emph></p>
<p>The areas generated by the fo:table-caption formatting object have
a value of "true" for the <trait>is-reference-area</trait>.</p>

<p><emph>Constraints:</emph></p>
<p>For the case when the value of the <trait>caption-side</trait>
trait is "before" or "after" the inline-progression-dimension of
the content-rectangle of the generated
reference-area is equal to the inline-progression-dimension of
the content-rectangle of the reference-area that encloses
it.</p>
<p>When the value is "start" or "end" the inline-progression-dimension
of the generated reference-area is constrained by the value of
the <trait>inline-progression-dimension</trait> trait.</p>
<p><spot id="fo01jr_1"/>When the value is "top", "bottom", "left", or
"right" the value is mapped in the same way as for corresponding
properties (see <specref ref="compcorr"/>) and the property is then
treated as if the corresponding value had been specified.</p>
<p><spot id="fo0001eg_b"/>If the caption
is to be positioned before the table, the areas generated by
the fo:table-caption shall be placed in the area tree as though the fo:table-caption
had a "keep-with-next" property with value "always".</p>
<p>If the caption is to be positioned after the table, the areas generated by
the fo:table-caption shall be placed in the area tree as though the fo:table-caption
had a "keep-with-previous" property with value "always".</p>
<p>No area may have more than one normal child area
returned by the same fo:table-caption formatting object.</p>
<p>The children of each normal area returned by an fo:table-caption
formatting object
must be normal <term>block-area</term>s returned by the children of
the fo:table-caption,
must be <term>properly stacked</term>, and
must be <term>properly ordered</term>.
</p>
<p>Any <term>reference-level-out-of-line</term>
areas returned by the children of the fo:table-caption
are handled as described in <specref ref="fo_float"/>.</p>

<p><emph>Contents:</emph></p>
<eg xml:space="preserve">
(<loc href="#block.fo.list" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">%block;</loc>)+
</eg>

<p>In addition this formatting object may have a sequence of
zero or more fo:markers as its initial children.</p>

<p><emph>The following properties apply to this formatting object:</emph></p><slist>
<sitem><specref ref="common-accessibility-properties"/></sitem>
<sitem><specref ref="common-aural-properties"/></sitem>
<sitem><specref ref="common-border-padding-and-background-properties"/></sitem>
<sitem><specref ref="common-relative-position-properties"/></sitem>
<sitem><specref ref="block-progression-dimension"/></sitem>
<sitem><specref ref="height"/></sitem>
<sitem><specref ref="id"/></sitem>
<sitem><specref ref="inline-progression-dimension"/></sitem>
<sitem><specref ref="intrusion-displace"/></sitem>
<sitem><specref ref="keep-together"/></sitem>
<sitem><specref ref="width"/></sitem>
</slist>
</div3>


<div3 id="fo_table-header"><head>fo:table-header</head>

<p><emph>Common Usage:</emph></p>
<p>The fo:table-header formatting object is used to contain
the content
of the table header.</p>

<p><emph>Areas:</emph></p>
<p>The fo:table-header formatting object does not generate any areas.  The
fo:table-header formatting object returns the sequence of areas created by
concatenating the sequences of areas returned by each of the children
of the fo:table-header.
</p>

<p><emph>Constraints:</emph></p>
<p>The order of concatenation of the sequences of areas returned by
the children of the fo:table-header
is the same order as the children are ordered under the fo:table-header.
</p>

<p><emph>Contents:</emph></p>
<eg xml:space="preserve">
(<loc href="#fo_table-row" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">table-row</loc>+|<loc href="#fo_table-cell" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">table-cell</loc>+)
</eg>

<p>The fo:table-header has fo:table-row (one or more) as
its children,
or alternatively fo:table-cell (one or more). In the latter case
cells are grouped into rows using the starts-row and ends-row properties.
</p>
<p>In addition this formatting object may have a sequence of
zero or more fo:markers as its initial children.</p>

<p><emph>The following properties apply to this formatting object:</emph></p><slist>
<sitem><specref ref="common-accessibility-properties"/></sitem>
<sitem><specref ref="common-aural-properties"/></sitem>
<sitem><specref ref="common-border-padding-and-background-properties"/><prnote><p>Only the background properties
from this set apply.
If the value of border-collapse is "collapse" or "collapse-with-precedence" for the table the
border properties also apply.</p>
</prnote></sitem>
<sitem><specref ref="common-relative-position-properties"/></sitem>
<sitem><specref ref="border-after-precedence"/></sitem>
<sitem><specref ref="border-before-precedence"/></sitem>
<sitem><specref ref="border-end-precedence"/></sitem>
<sitem><specref ref="border-start-precedence"/></sitem>
<sitem><specref ref="id"/></sitem>
<sitem><specref ref="visibility"/></sitem>
</slist>
</div3>


<div3 id="fo_table-footer"><head>fo:table-footer</head>

<p><emph>Common Usage:</emph></p>
<p>The fo:table-footer formatting object is used to contain
the content
of the table footer.</p>

<p><emph>Areas:</emph></p>
<p>The fo:table-footer formatting object does not generate any areas.  The
fo:table-footer formatting object returns the sequence of areas created by
concatenating the sequences of areas returned by each of the children
of the fo:table-footer.
</p>

<p><emph>Constraints:</emph></p>
<p>The order of concatenation of the sequences of areas returned by
the children of the fo:table-footer
is the same order as the children are ordered under the fo:table-footer.
</p>

<p><emph>Contents:</emph></p>
<eg xml:space="preserve">
(<loc href="#fo_table-row" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">table-row</loc>+|<loc href="#fo_table-cell" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">table-cell</loc>+)
</eg>

<p>The fo:table-footer has fo:table-row (one or more) as
its children,
or alternatively fo:table-cell (one or more). In the latter case
cells are grouped into rows using the starts-row and ends-row properties.
</p>
<p>In addition this formatting object may have a sequence of
zero or more fo:markers as its initial children.</p>

<p><emph>The following properties apply to this formatting object:</emph></p><slist>
<sitem><specref ref="common-accessibility-properties"/></sitem>
<sitem><specref ref="common-aural-properties"/></sitem>
<sitem><specref ref="common-border-padding-and-background-properties"/><prnote><p>Only the background properties
from this set apply.
If the value of border-collapse is "collapse" or "collapse-with-precedence" for the table the
border properties also apply.</p>
</prnote></sitem>
<sitem><specref ref="common-relative-position-properties"/></sitem>
<sitem><specref ref="border-after-precedence"/></sitem>
<sitem><specref ref="border-before-precedence"/></sitem>
<sitem><specref ref="border-end-precedence"/></sitem>
<sitem><specref ref="border-start-precedence"/></sitem>
<sitem><specref ref="id"/></sitem>
<sitem><specref ref="visibility"/></sitem>
</slist>
</div3>


<div3 id="fo_table-body"><head>fo:table-body</head>

<p><emph>Common Usage:</emph></p>
<p>The fo:table-body formatting object is used to contain
the content
of the table body.</p>

<p><emph>Areas:</emph></p>
<p>The fo:table-body formatting object does not generate any areas.  The
fo:table-body formatting object returns the sequence of areas created by
concatenating the sequences of areas returned by each of the children
of the fo:table-body.
</p>

<p><emph>Constraints:</emph></p>
<p>The order of concatenation of the sequences of areas returned by
the children of the fo:table-body
is the same order as the children are ordered under the fo:table-body.
</p>

<p><emph>Contents:</emph></p>
<eg xml:space="preserve">
(<loc href="#fo_table-row" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">table-row</loc>+|<loc href="#fo_table-cell" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">table-cell</loc>+)
</eg>

<p>The fo:table-body has fo:table-row (one or more) as its
children,
or alternatively fo:table-cell (one or more). In the latter case
cells are grouped into rows using the starts-row and ends-row properties.
</p>
<p>In addition this formatting object may have a sequence of
zero or more fo:markers as its initial children.</p>

<p><emph>The following properties apply to this formatting object:</emph></p><slist>
<sitem><specref ref="common-accessibility-properties"/></sitem>
<sitem><specref ref="common-aural-properties"/></sitem>
<sitem><specref ref="common-border-padding-and-background-properties"/><prnote><p>Only the background properties
from this set apply.
If the value of border-collapse is "collapse" or "collapse-with-precedence" for the table the
border properties also apply.</p>
</prnote></sitem>
<sitem><specref ref="common-relative-position-properties"/></sitem>
<sitem><specref ref="border-after-precedence"/></sitem>
<sitem><specref ref="border-before-precedence"/></sitem>
<sitem><specref ref="border-end-precedence"/></sitem>
<sitem><specref ref="border-start-precedence"/></sitem>
<sitem><specref ref="id"/></sitem>
<sitem><specref ref="visibility"/></sitem>
</slist>
</div3>


<div3 id="fo_table-row"><head>fo:table-row</head>

<p><emph>Common Usage:</emph></p>
<p>The fo:table-row formatting object is used to group
table-cells into
rows; all table-cells in a table-row start in the same geometric row on
the table grid.</p>

<p><emph>Areas:</emph></p>
<p>The fo:table-row formatting object does not generate any areas.  The
fo:table-row formatting object returns the sequence of areas created by
concatenating the sequences of areas returned by each of the children
of the fo:table-row.
<spot id="c14i2_b"/>The fo:table-row holds
a specification of some presentation
characteristics, <spot id="c14i2_c"/>such as background which
affects the areas generated by the fo:table (see <specref ref="fo_table"/>).
</p>

<p><emph>Constraints:</emph></p>
<p>The order of concatenation of the sequences of areas returned by
the children of the fo:table-row
is the same order as the children are ordered under the fo:table-row.
</p>
<p>The method for determining the height of the row in the grid is
governed by the <trait>row-height</trait> trait.</p>

<p><emph>Contents:</emph></p>
<eg xml:space="preserve">
(<loc href="#fo_table-cell" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">table-cell</loc>+)
</eg>

<p><emph>The following properties apply to this formatting object:</emph></p><slist>
<sitem><specref ref="common-accessibility-properties"/></sitem>
<sitem><specref ref="block-progression-dimension"/></sitem>
<sitem><specref ref="common-aural-properties"/></sitem>
<sitem><specref ref="common-border-padding-and-background-properties"/><prnote><p><spot id="c17i1_b"/>Only the background properties
from this set apply.
If the value of border-collapse is "collapse" or "collapse-with-precedence" for the table the
border properties also apply.</p>
</prnote></sitem>

<sitem><specref ref="common-relative-position-properties"/></sitem>
<sitem><specref ref="border-after-precedence"/></sitem>
<sitem><specref ref="border-before-precedence"/></sitem>
<sitem><specref ref="border-end-precedence"/></sitem>
<sitem><specref ref="border-start-precedence"/></sitem>
<sitem><specref ref="break-after"/></sitem>
<sitem><specref ref="break-before"/></sitem>
<sitem><specref ref="id"/></sitem>
<sitem><specref ref="height"/></sitem>
<sitem><specref ref="keep-together"/></sitem>
<sitem><specref ref="keep-with-next"/></sitem>
<sitem><specref ref="keep-with-previous"/></sitem>
<sitem><specref ref="visibility"/></sitem>
</slist>
</div3>


<div3 id="fo_table-cell"><head>fo:table-cell</head>

<p><emph>Common Usage:</emph></p>
<p>The fo:table-cell formatting object is used to group
content to be
placed in a <spot id="c11i42_b"/>table cell.</p>
<p><spot id="aj000035_34"/>The "starts-row" and "ends-row" properties can be
used when the input data does not have elements containing
the cells in each row, but instead, for example, each row starts
at elements of a particular type.</p>

<p><emph>Areas:</emph></p>
<p>The fo:table-cell formatting object generates one or more
<term>normal</term> <term>reference-area</term>s.
The fo:table-cell returns these reference-areas and any
<term>page-level-out-of-line</term> areas
returned by the children of the fo:table-cell.</p>

<p><emph>Trait Derivation:</emph></p>
<p>The areas generated by the fo:table-cell formatting object have
a value of "true" for the <trait>is-reference-area</trait>.</p>
<p>The method for deriving the border for a cell is
specified by the <trait>border-collapse</trait> trait.</p>
<p>If the value of the <trait>border-collapse</trait> trait is "separate" the border
is composed of two components. The first, which is placed
with the outside edge coincident with the table grid boundary line,
has the width of half the value for the <trait>border-separation</trait> trait.
It is filled in accordance with the <trait>background</trait> trait of the fo:table.
Inside this border is placed, for each side of the cell, a border based
on a border specified on the cell or inherited.</p>
<p>If the value of the <trait>border-collapse</trait> trait is "collapse-with-precedence" the border
for each side of the cell is determined by, for each segment of a border,
selecting, from all border specifications for that segment, the border
that has the highest <spot id="aj000036_1b"/>precedence. It is an error if there are two such
borders that have the same <spot id="aj000036_1c"/>precedence but are not identical.
<spot id="js010063_3"/>An implementation may recover by selecting
one of the borders.
Each border segment is placed centered on the table grid boundary line.
<spot id="fo_sg_06"/>On devices that do not support sub-pixel rendering,
if an effective border width is determined to be an odd number of pixels
it is implementation defined on which side of the grid <spot id="js010055_2"/>boundary line
the odd pixel is placed.
</p>
<p>If the value of the border-collapse trait is "collapse", the border for
each side of the cell is determined by, for each segment of a border,
selecting, from all border specifications for that segment, the border that
has the most "eye catching" border style, see below for the details. Each
border segment is placed centered on the table grid boundary line. On
devices that do not support sub-pixel rendering, if an effective border
width is determined to be an odd number of pixels it is implementation
defined on which side of the grid boundary line the odd pixel is placed.
Where there is a conflict between the styles of border segments that
collapse, the following rules determine which border style "wins":</p>
<olist>
<item>
<p>Borders with the 'border-style' of 'hidden' take precedence over all
other conflicting borders. Any border with this value suppresses all
borders at this location.</p>
</item>
<item>
<p>Borders with a style of 'none' have the lowest priority. Only if the
border properties of all the elements meeting at this edge are 'none' will
the border be omitted (but note that 'none' is the default value for the
border style.)</p>
</item>
<item>
<p>If none of the styles is 'hidden' and at least one of them is not
'none', then narrow borders are discarded in favor of wider ones.</p>
</item>
<item>
<p>If the remaining border styles have the same 'border-width' than styles
are preferred in this order: 'double', 'solid', 'dashed', 'dotted',
'ridge', 'outset', 'groove', and the lowest: 'inset'.</p>
</item>
<item>
<p>If border styles differ only in color, then a style set on a cell wins
over one on a row, which wins over a row group, column, column group and,
lastly, table.
</p>
</item>
</olist>

<p><emph>Constraints:</emph></p>
<p>A table-cell occupies one or more grid units in the
row-progression-direction and
column-progression-direction.
The content-rectangle of the cell is the size of the portion
of the grid
the cell occupies minus, for each of the four sides:</p>
<ulist>
<item><p>If the value of the <trait>border-collapse</trait> trait is "separate":
half the value of the <trait>border-separation</trait> trait; otherwise 0.</p>
</item>
<item><p>If the value of the <trait>border-collapse</trait> trait is "separate":
the thickness of the cell-border; otherwise half the thickness of the
effective border.</p>
</item>
<item><p>The cell padding.</p>
</item>
</ulist>
<p>The method for determining the block-progression-dimension
of the cell in the grid is governed by the <trait>row-height</trait> trait.</p>
<p>No area may have more than one normal child area
returned by the same fo:table-cell formatting object.</p>
<p>The children of each normal area returned by an fo:table-cell
formatting object
must be normal <term>block-area</term>s returned by the children of
the fo:table-cell,
must be <term>properly stacked</term>, and
must be <term>properly ordered</term>.
</p>
<p>Any <term>reference-level-out-of-line</term>
areas returned by the children of the fo:table-cell
are handled as described in <specref ref="fo_float"/>.</p>

<p><emph>Contents:</emph></p>
<eg xml:space="preserve">
(<loc href="#block.fo.list" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">%block;</loc>)+
</eg>

<p>In addition this formatting object may have a sequence of
zero or more fo:markers as its initial children.</p>

<p><emph>The following properties apply to this formatting object:</emph></p><slist>
<sitem><specref ref="common-accessibility-properties"/></sitem>
<sitem><specref ref="common-aural-properties"/></sitem>
<sitem><specref ref="common-border-padding-and-background-properties"/></sitem>
<sitem><specref ref="common-relative-position-properties"/></sitem>
<sitem><specref ref="border-after-precedence"/></sitem>
<sitem><specref ref="border-before-precedence"/></sitem>
<sitem><specref ref="border-end-precedence"/></sitem>
<sitem><specref ref="border-start-precedence"/></sitem>
<sitem><specref ref="block-progression-dimension"/></sitem>
<sitem><specref ref="column-number"/></sitem>
<sitem><specref ref="display-align"/></sitem>
<sitem><specref ref="relative-align"/></sitem>
<sitem><specref ref="empty-cells"/></sitem>
<sitem><specref ref="ends-row"/></sitem>
<sitem><specref ref="height"/></sitem>
<sitem><specref ref="id"/></sitem>
<sitem><specref ref="inline-progression-dimension"/></sitem>
<sitem><specref ref="number-columns-spanned"/></sitem>
<sitem><specref ref="number-rows-spanned"/></sitem>
<sitem><specref ref="starts-row"/></sitem>
<sitem><specref ref="width"/></sitem>
</slist>
</div3>


</div2>

<div2>
<head>Formatting Objects for Lists</head>

<div3><head>Introduction</head>
<p>There are four formatting objects used to construct lists:
fo:list-block, fo:list-item, fo:list-item-label, and fo:list-item-body.
</p>
<figure>
<graphic source="ListTree.gif" alt="Tree representation of the Formatting Objects for lists" longdesc="A tree representation of list Formatting Objects showing how they fit within one another." xml:attributes="href source" show="embed" actuate="auto" xmlns:xlink="http://www.w3.org/TR/WD-xlink"/>
<figcap><p>Tree representation of the formatting Objects for Lists.</p>
</figcap>
</figure>
<p>The fo:list-block has the role of containing the complete list and
<spot id="c11i63"/>of specifying values used for the list geometry in the
inline-progression-direction (see details below).</p>
<p>The children of the fo:list-block are one or more fo:list-item, each
containing a pair of fo:list-item-label and fo:list-item-body.</p>
<p>The fo:list-item has the role of containing each item in a list.</p>
<p>The fo:list-item-label has the role of containing the content,
block-level formatting objects, of the label for the
list-item; typically an fo:block containing
a number, a <spot id="c11i64"/>dingbat character, or a term.</p>
<p>The fo:list-item-body has the role of containing the content,
block-level formatting objects, of the body of the
list-item; typically one or more fo:block.</p>
<p>The placement, in the block-progression-direction, of the
label with respect to the body is made in accordance with the
"vertical-align" property of the fo:list-item.</p>
<graphic source="ListGeom.gif" alt="Areas generated by a list" longdesc="A rendering of a sample list-block Formatting Object, naming the distances and the indents between each generated area." xml:attributes="href source" show="embed" actuate="auto" xmlns:xlink="http://www.w3.org/TR/WD-xlink"/>
<p>The specification of the list geometry in the
inline-progression-direction is achieved by:</p>
<ulist>
<item>
<p>Specifying appropriate values of the "provisional-distance-between-starts"
and "provisional-label-separation" properties.
The "provisional-distance-between-starts" specifies the desired
distance between the start-indents of the label and the body of
the list-item.
The "provisional-label-separation" specifies the desired
separation between the end-indent of the label and the start-indent
of the body of the list-item.
</p>
</item>
<item>
<p>Specifying end-indent="label-end()" on the fo:list-item-label.
</p>
<p>Specifying start-indent="body-start()" on the fo:list-item-body.
</p>
<note><p>These list specific functions are defined in
<specref ref="provisional-label-separation"/> and
<specref ref="provisional-distance-between-starts"/>.</p>
</note>
</item>
</ulist>
<p>The start-indent of the list-item-label and end-indent of the
list-item-body, if desired, are typically specified as a length.</p>

<div4><head>Examples</head>

<div5><head><spot id="aj000035_35a"/>Enumerated List</head>
<p>The list-items are contained in an <code>"ol"</code>
element. The items are
contained in <code>"item"</code> elements and contain text (as opposed to
paragraphs).</p>
<p>The style is to <spot id="aj000035_35b"/>enumerate the items
alphabetically with a dot after
the letter.</p>
<p><spot id="c11i65"/>Input sample:</p>
<eg xml:space="preserve">
&lt;ol&gt;
&lt;item&gt;List item 1.&lt;/item&gt;
&lt;item&gt;List item 2.&lt;/item&gt;
&lt;item&gt;List item 3.&lt;/item&gt;
&lt;/ol&gt;
</eg>
<p>XSL Stylesheet:</p>
<eg xml:space="preserve">
&lt;?xml version='1.0'?&gt;
&lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:fo="http://www.w3.org/1999/XSL/Format"
                version='1.0'&gt;

&lt;xsl:template match="ol"&gt;
  &lt;fo:list-block provisional-distance-between-starts="15mm"
   provisional-label-separation="5mm"&gt;
    &lt;xsl:apply-templates/&gt;
  &lt;/fo:list-block&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match="ol/item"&gt;
  &lt;fo:list-item&gt;
    &lt;fo:list-item-label start-indent="5mm" end-indent="label-end()"&gt;
      &lt;fo:block&gt;
        &lt;xsl:number format="a."/&gt;
      &lt;/fo:block&gt;
    &lt;/fo:list-item-label&gt;
    &lt;fo:list-item-body start-indent="body-start()"&gt;
      &lt;fo:block&gt;
        &lt;xsl:apply-templates/&gt;
      &lt;/fo:block&gt;
    &lt;/fo:list-item-body&gt;
  &lt;/fo:list-item&gt;
&lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;
</eg>
<p>Result Instance: elements and attributes in the fo:
namespace</p>
<eg xml:space="preserve">
&lt;fo:list-block provisional-distance-between-starts="15mm"
  provisional-label-separation="5mm"&gt;

  &lt;fo:list-item&gt;
    &lt;fo:list-item-label start-indent="5mm" end-indent="label-end()"&gt;
      &lt;fo:block&gt;a.
      &lt;/fo:block&gt;
    &lt;/fo:list-item-label&gt;
    &lt;fo:list-item-body start-indent="body-start()"&gt;
      &lt;fo:block&gt;List item 1.
      &lt;/fo:block&gt;
    &lt;/fo:list-item-body&gt;
  &lt;/fo:list-item&gt;

  &lt;fo:list-item&gt;
    &lt;fo:list-item-label start-indent="5mm" end-indent="label-end()"&gt;
      &lt;fo:block&gt;b.
      &lt;/fo:block&gt;
    &lt;/fo:list-item-label&gt;
    &lt;fo:list-item-body start-indent="body-start()"&gt;
      &lt;fo:block&gt;List item 2.
      &lt;/fo:block&gt;
    &lt;/fo:list-item-body&gt;
  &lt;/fo:list-item&gt;

  &lt;fo:list-item&gt;
    &lt;fo:list-item-label start-indent="5mm" end-indent="label-end()"&gt;
      &lt;fo:block&gt;c.
      &lt;/fo:block&gt;
    &lt;/fo:list-item-label&gt;
    &lt;fo:list-item-body start-indent="body-start()"&gt;
      &lt;fo:block&gt;List item 3.
      &lt;/fo:block&gt;
    &lt;/fo:list-item-body&gt;
  &lt;/fo:list-item&gt;

&lt;/fo:list-block&gt;
</eg>
</div5>

<div5><head>HTML-style <code>"dl"</code> lists</head>
<p>In this example the stylesheet processes HTML-style <code>"dl"</code> lists, which
contain unwrapped pairs of <code>"dt"</code> and <code>"dd"</code> elements, transforming
them into fo:list-blocks.</p>
<p>Balanced pairs of <code>"dt"</code>/<code>"dd"</code>s are converted into fo:list-items.
For unbalanced <code>"dt"</code>/<code>"dd"</code>s, the stylesheet makes the
following assumptions:</p>
<ulist>
<item><p>Multiple <code>"dt"</code>s are grouped together into a single
fo:list-item-label in a single list-item.</p></item>
<item><p>Multiple DDs are:</p>
<ulist>
<item><p>Output as individual FO list-items with an empty
list-item-label if the stylesheet variable
<code>$allow-naked-dd</code> is <code>true</code>.</p></item>
<item><p>Are grouped together into a single FO list-item-body if
<code>$allow-naked-dd</code> is <code>false</code>.</p></item>
</ulist>
</item>
</ulist>
<p>In other words, given a structure like this:</p>
<eg xml:space="preserve">
&lt;doc&gt;
&lt;dl&gt;
  &lt;dt&gt;term&lt;/dt&gt;
  &lt;dd&gt;definition&lt;/dd&gt;
  &lt;dt&gt;term&lt;/dt&gt;
  &lt;dt&gt;term&lt;/dt&gt;
  &lt;dd&gt;definition&lt;/dd&gt;
  &lt;dt&gt;term&lt;/dt&gt;
  &lt;dd&gt;definition&lt;/dd&gt;
  &lt;dd&gt;definition&lt;/dd&gt;
&lt;/dl&gt;
&lt;/doc&gt;
</eg>
<p>If <code>$allow-naked-dd</code> is <code>true</code>, the result instance: elements
and attributes in the fo: namespace is:</p>
<eg xml:space="preserve">
&lt;fo:list-block provisional-distance-between-starts="35mm"
  provisional-label-separation="5mm"&gt;
  &lt;fo:list-item&gt;
    &lt;fo:list-item-label end-indent="label-end()"&gt;
      &lt;fo:block&gt;term
      &lt;/fo:block&gt;
    &lt;/fo:list-item-label&gt;
    &lt;fo:list-item-body start-indent="body-start()"&gt;
      &lt;fo:block&gt;definition
      &lt;/fo:block&gt;
    &lt;/fo:list-item-body&gt;
  &lt;/fo:list-item&gt;
  &lt;fo:list-item&gt;
    &lt;fo:list-item-label end-indent="label-end()"&gt;
      &lt;fo:block&gt;term
      &lt;/fo:block&gt;
      &lt;fo:block&gt;term
      &lt;/fo:block&gt;
    &lt;/fo:list-item-label&gt;
    &lt;fo:list-item-body start-indent="body-start()"&gt;
      &lt;fo:block&gt;definition
      &lt;/fo:block&gt;
    &lt;/fo:list-item-body&gt;
  &lt;/fo:list-item&gt;
  &lt;fo:list-item&gt;
    &lt;fo:list-item-label end-indent="label-end()"&gt;
      &lt;fo:block&gt;term
      &lt;/fo:block&gt;
    &lt;/fo:list-item-label&gt;
    &lt;fo:list-item-body start-indent="body-start()"&gt;
      &lt;fo:block&gt;definition
      &lt;/fo:block&gt;
    &lt;/fo:list-item-body&gt;
  &lt;/fo:list-item&gt;
  &lt;fo:list-item&gt;
    &lt;fo:list-item-label end-indent="label-end()"&gt;
    &lt;/fo:list-item-label&gt;
    &lt;fo:list-item-body start-indent="body-start()"&gt;
      &lt;fo:block&gt;definition
      &lt;/fo:block&gt;
    &lt;/fo:list-item-body&gt;
  &lt;/fo:list-item&gt;
&lt;/fo:list-block&gt;
</eg>
<p>If <code>$allow-naked-dd</code> is <code>false</code>, the result instance:
elements and attributes in the fo: namespace is:</p>
<eg xml:space="preserve">
&lt;fo:list-block provisional-distance-between-starts="35mm"
  provisional-label-separation="5mm"&gt;
  &lt;fo:list-item&gt;
    &lt;fo:list-item-label end-indent="label-end()"&gt;
      &lt;fo:block&gt;term
      &lt;/fo:block&gt;
    &lt;/fo:list-item-label&gt;
    &lt;fo:list-item-body start-indent="body-start()"&gt;
      &lt;fo:block&gt;definition
      &lt;/fo:block&gt;
    &lt;/fo:list-item-body&gt;
  &lt;/fo:list-item&gt;
  &lt;fo:list-item&gt;
    &lt;fo:list-item-label end-indent="label-end()"&gt;
      &lt;fo:block&gt;term
      &lt;/fo:block&gt;
      &lt;fo:block&gt;term
      &lt;/fo:block&gt;
    &lt;/fo:list-item-label&gt;
    &lt;fo:list-item-body start-indent="body-start()"&gt;
      &lt;fo:block&gt;definition
      &lt;/fo:block&gt;
    &lt;/fo:list-item-body&gt;
  &lt;/fo:list-item&gt;
  &lt;fo:list-item&gt;
    &lt;fo:list-item-label end-indent="label-end()"&gt;
      &lt;fo:block&gt;term
      &lt;/fo:block&gt;
    &lt;/fo:list-item-label&gt;
    &lt;fo:list-item-body start-indent="body-start()"&gt;
      &lt;fo:block&gt;definition
      &lt;/fo:block&gt;
      &lt;fo:block&gt;definition
      &lt;/fo:block&gt;
    &lt;/fo:list-item-body&gt;
  &lt;/fo:list-item&gt;
&lt;/fo:list-block&gt;
</eg>
<p>XSL Stylesheet:</p>
<eg xml:space="preserve">
&lt;?xml version='1.0'?&gt;
&lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:fo="http://www.w3.org/1999/XSL/Format"
                version='1.0'&gt;

&lt;xsl:include href="dtdd.xsl"/&gt;

&lt;xsl:template match="doc"&gt;
  &lt;xsl:apply-templates/&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match="dl"&gt;
  &lt;xsl:call-template name="process.dl"/&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match="dt|dd"&gt;
  &lt;fo:block&gt;
    &lt;xsl:apply-templates/&gt;
  &lt;/fo:block&gt;
&lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;
</eg>
<p>Included stylesheet "dtdd.xsl"</p>
<eg xml:space="preserve">
&lt;?xml version='1.0'?&gt;
&lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:fo="http://www.w3.org/1999/XSL/Format"
                version='1.0'&gt;

&lt;xsl:variable name="allow-naked-dd" select="true()"/&gt;

&lt;xsl:template name="process.dl"&gt;
  &lt;fo:list-block provisional-distance-between-starts="35mm"
   provisional-label-separation="5mm"&gt;
    &lt;xsl:choose&gt;
      &lt;xsl:when test="$allow-naked-dd"&gt;
        &lt;xsl:call-template name="process.dl.content.with.naked.dd"/&gt;
      &lt;/xsl:when&gt;
      &lt;xsl:otherwise&gt;
        &lt;xsl:call-template name="process.dl.content"/&gt;
      &lt;/xsl:otherwise&gt;
    &lt;/xsl:choose&gt;
  &lt;/fo:list-block&gt;
&lt;/xsl:template&gt;

&lt;xsl:template name="process.dl.content.with.naked.dd"&gt;
  &lt;xsl:param name="dts" select="./force-list-to-be-empty"/&gt;
  &lt;xsl:param name="nodes" select="*"/&gt;

  &lt;xsl:choose&gt;
    &lt;xsl:when test="count($nodes)=0"&gt;
      &lt;!-- Out of nodes, output any pending DTs --&gt;
      &lt;xsl:if test="count($dts)&gt;0"&gt;
        &lt;fo:list-item&gt;
          &lt;fo:list-item-label end-indent="label-end()"&gt;
            &lt;xsl:apply-templates select="$dts"/&gt;
          &lt;/fo:list-item-label&gt;
          &lt;fo:list-item-body start-indent="body-start()"/&gt;
        &lt;/fo:list-item&gt;
      &lt;/xsl:if&gt;
    &lt;/xsl:when&gt;

    &lt;xsl:when test="name($nodes[1])='dd'"&gt;
      &lt;!-- We found a DD, output the DTs and the DD --&gt;
      &lt;fo:list-item&gt;
        &lt;fo:list-item-label end-indent="label-end()"&gt;
          &lt;xsl:apply-templates select="$dts"/&gt;
        &lt;/fo:list-item-label&gt;
        &lt;fo:list-item-body start-indent="body-start()"&gt;
          &lt;xsl:apply-templates select="$nodes[1]"/&gt;
        &lt;/fo:list-item-body&gt;
      &lt;/fo:list-item&gt;
      &lt;xsl:call-template name="process.dl.content.with.naked.dd"&gt;
        &lt;xsl:with-param name="nodes" select="$nodes[position()&gt;1]"/&gt;
      &lt;/xsl:call-template&gt;
    &lt;/xsl:when&gt;

    &lt;xsl:when test="name($nodes[1])='dt'"&gt;
      &lt;!-- We found a DT, add it to the list of DTs and loop --&gt;
      &lt;xsl:call-template name="process.dl.content.with.naked.dd"&gt;
        &lt;xsl:with-param name="dts" select="$dts|$nodes[1]"/&gt;
        &lt;xsl:with-param name="nodes" select="$nodes[position()&gt;1]"/&gt;
      &lt;/xsl:call-template&gt;
    &lt;/xsl:when&gt;

    &lt;xsl:otherwise&gt;
      &lt;!-- This shouldn't happen --&gt;
      &lt;xsl:message&gt;
        &lt;xsl:text&gt;DT/DD list contained something bogus (&lt;/xsl:text&gt;
        &lt;xsl:value-of select="name($nodes[1])"/&gt;
        &lt;xsl:text&gt;).&lt;/xsl:text&gt;
      &lt;/xsl:message&gt;
    &lt;/xsl:otherwise&gt;
  &lt;/xsl:choose&gt;
&lt;/xsl:template&gt;

&lt;xsl:template name="process.dl.content"&gt;
  &lt;xsl:param name="dts" select="./force-list-to-be-empty"/&gt;
  &lt;xsl:param name="dds" select="./force-list-to-be-empty"/&gt;
  &lt;xsl:param name="output-on"&gt;&lt;/xsl:param&gt;
  &lt;xsl:param name="nodes" select="*"/&gt;

  &lt;!-- The algorithm here is to build up a list of DTs and DDs, --&gt;
  &lt;!-- outputing them only on the transition from DD back to DT --&gt;

  &lt;xsl:choose&gt;
    &lt;xsl:when test="count($nodes)=0"&gt;
      &lt;!-- Out of nodes, output any pending elements --&gt;
      &lt;xsl:if test="count($dts)&gt;0 or count($dds)&gt;0"&gt;
        &lt;fo:list-item&gt;
          &lt;fo:list-item-label end-indent="label-end()"&gt;
            &lt;xsl:apply-templates select="$dts"/&gt;
          &lt;/fo:list-item-label&gt;
          &lt;fo:list-item-body start-indent="body-start()"&gt;
            &lt;xsl:apply-templates select="$dds"/&gt;
          &lt;/fo:list-item-body&gt;
        &lt;/fo:list-item&gt;
      &lt;/xsl:if&gt;
    &lt;/xsl:when&gt;

    &lt;xsl:when test="name($nodes[1])=$output-on"&gt;
      &lt;!-- We're making the transition from DD back to DT --&gt;
      &lt;fo:list-item&gt;
        &lt;fo:list-item-label end-indent="label-end()"&gt;
          &lt;xsl:apply-templates select="$dts"/&gt;
        &lt;/fo:list-item-label&gt;
        &lt;fo:list-item-body start-indent="body-start()"&gt;
          &lt;xsl:apply-templates select="$dds"/&gt;
        &lt;/fo:list-item-body&gt;
      &lt;/fo:list-item&gt;

      &lt;!-- Reprocess this node (and the rest of the node list) --&gt;
      &lt;!-- resetting the output-on state to nil --&gt;
      &lt;xsl:call-template name="process.dl.content"&gt;
        &lt;xsl:with-param name="nodes" select="$nodes"/&gt;
      &lt;/xsl:call-template&gt;
    &lt;/xsl:when&gt;

    &lt;xsl:when test="name($nodes[1])='dt'"&gt;
      &lt;!-- We found a DT, add it to the list and loop --&gt;
      &lt;xsl:call-template name="process.dl.content"&gt;
        &lt;xsl:with-param name="dts" select="$dts|$nodes[1]"/&gt;
        &lt;xsl:with-param name="dds" select="$dds"/&gt;
        &lt;xsl:with-param name="nodes" select="$nodes[position()&gt;1]"/&gt;
      &lt;/xsl:call-template&gt;
    &lt;/xsl:when&gt;

    &lt;xsl:when test="name($nodes[1])='dd'"&gt;
      &lt;!-- We found a DD, add it to the list and loop, noting that --&gt;
      &lt;!-- the next time we cross back to DT's, we need to output the --&gt;
      &lt;!-- current DT/DDs. --&gt;
      &lt;xsl:call-template name="process.dl.content"&gt;
        &lt;xsl:with-param name="dts" select="$dts"/&gt;
        &lt;xsl:with-param name="dds" select="$dds|$nodes[1]"/&gt;
        &lt;xsl:with-param name="output-on"&gt;dt&lt;/xsl:with-param&gt;
        &lt;xsl:with-param name="nodes" select="$nodes[position()&gt;1]"/&gt;
      &lt;/xsl:call-template&gt;
    &lt;/xsl:when&gt;

    &lt;xsl:otherwise&gt;
      &lt;!-- This shouldn't happen --&gt;
      &lt;xsl:message&gt;
        &lt;xsl:text&gt;DT/DD list contained something bogus (&lt;/xsl:text&gt;
        &lt;xsl:value-of select="name($nodes[1])"/&gt;
        &lt;xsl:text&gt;).&lt;/xsl:text&gt;
      &lt;/xsl:message&gt;
    &lt;/xsl:otherwise&gt;
  &lt;/xsl:choose&gt;
&lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;
</eg>
<p>The "dtdd.xsl" stylesheet may be customized in the following ways:</p>
<ulist>
<item><p>Set the value of <code>$allow-naked-dd</code> to control the processing of unbalanced
<code>"dd"</code>s.</p></item>
<item>
<p>Change <code>"dt"</code> to the name of the element
which is a term in the list.</p></item>
<item>
<p>Change <code>"dd"</code> to the name of the element
which is a definition in the list.</p></item>
<item>
<p>In the, perhaps unlikely, event that the documents may contain
an element named <code>"force-list-to-be-empty"</code>, that element name
should be changed to a name that is not used in the documents.</p>
</item>
</ulist>
<p>In the stylesheet using the "dtdd.xsl" stylesheet change the <code>"dl"</code>
to the name of the element which is the wrapper for the list.</p>
</div5>
</div4>
</div3>


<div3 id="fo_list-block"><head>fo:list-block</head>

<p><emph>Common Usage:</emph></p>
<p>The fo:list-block flow object is used to format a list.</p>

<p><emph>Areas:</emph></p>
<p>The fo:list-block formatting object generates one or more
<term>normal</term> <term>block-area</term>s.
The fo:list-block returns these areas, any
<term>page-level-out-of-line</term> areas, and
any <term>reference-level-out-of-line</term> areas
returned by the children of the fo:list-block.</p>

<p><emph>Constraints:</emph></p>
<p>No area may have more than one normal child area
returned by the same fo:list-block formatting object.</p>
<p>The children of each normal area returned by an fo:list-block
formatting object
must be normal <term>block-area</term>s returned by the children of the fo:list-block,
must be <term>properly stacked</term>, and
must be <term>properly ordered</term>.
</p>

<p><emph>Contents:</emph></p>
<eg xml:space="preserve">
(<loc href="#fo_list-item" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">list-item</loc>+)
</eg>

<p>In addition this formatting object may have a sequence of
zero or more fo:markers as its initial children.</p>

<p><emph>The following properties apply to this formatting object:</emph></p><slist>
<sitem><specref ref="common-accessibility-properties"/></sitem>
<sitem><specref ref="common-aural-properties"/></sitem>
<sitem><specref ref="common-border-padding-and-background-properties"/></sitem>

<sitem><specref ref="common-margin-properties-block"/></sitem>
<sitem><specref ref="common-relative-position-properties"/></sitem>
<sitem><specref ref="break-after"/></sitem>
<sitem><specref ref="break-before"/></sitem>
<sitem><specref ref="id"/></sitem>
<sitem><specref ref="intrusion-displace"/></sitem>
<sitem><specref ref="keep-together"/></sitem>
<sitem><specref ref="keep-with-next"/></sitem>
<sitem><specref ref="keep-with-previous"/></sitem>
<sitem><specref ref="provisional-distance-between-starts"/></sitem>
<sitem><specref ref="provisional-label-separation"/></sitem>
</slist>
</div3>


<div3 id="fo_list-item"><head>fo:list-item</head>

<p><emph>Common Usage:</emph></p>
<p>The fo:list-item formatting object contains the label and the
body of an item in a list.</p>

<p><emph>Areas:</emph></p>
<p>The fo:list-item formatting object generates one or more
<term>normal</term> <term>block-area</term>s.
The fo:list-item returns these areas, any
<term>page-level-out-of-line</term> areas, and
any <term>reference-level-out-of-line</term> areas
returned by the children of the fo:list-item.</p>

<p><emph>Constraints:</emph></p>
<p>No area may have more than one normal child area
returned by the same fo:list-item formatting object.</p>
<p>The children of each normal area returned by an fo:list-item
formatting object must be normal <term>block-area</term>s returned by
the fo:list-item-label and the fo:list-item-body flow objects and
must be <term>properly ordered</term>.
Those returned by the fo:list-item-label
must be <term>properly stacked</term> and
those returned by the fo:list-item-body
must be <term>properly stacked</term>.
</p>
<p>The children of each normal area returned by an fo:list-item
formatting object returned by the
fo:list-item-label
and fo:list-item-body objects are positioned
in the block-progression-direction with respect to each
other according to the <trait>relative-align</trait> trait.</p>
<p>In the inline-progression-direction
these areas are positioned in the usual manner for properly
stacked areas.
It is an error if the content-rectangles of the areas overlap.
</p>
<p><spot id="fo_sg_13"/>The block-progression-dimension of the
content-rectangle of an area
generated by the fo:list-item is just large enough so that the
allocation-rectangles of all its child areas are contained in it. In
particular, the space-before and space-after of the child areas have no
effect on the spacing of the list item. For purposes of the
block-stacking constraints the areas generated by fo:list-item are
treated as if there they have a fence preceding and a fence following
them.</p>
<note><p>These areas are not reference-areas, hence the indents on all
objects within them are measured relative to the reference-area that
holds the content of the fo:list-block.</p>
</note>

<p><emph>Contents:</emph></p>
<eg xml:space="preserve">
(<loc href="#fo_list-item-label" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">list-item-label</loc>,<loc href="#fo_list-item-body" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">list-item-body</loc>)
</eg>

<p>In addition this formatting object may have a sequence of
zero or more fo:markers as its initial children.</p>

<p><emph>The following properties apply to this formatting object:</emph></p><slist>
<sitem><specref ref="common-accessibility-properties"/></sitem>
<sitem><specref ref="common-aural-properties"/></sitem>
<sitem><specref ref="common-border-padding-and-background-properties"/></sitem>

<sitem><specref ref="common-margin-properties-block"/></sitem>
<sitem><specref ref="common-relative-position-properties"/></sitem>
<sitem><specref ref="break-after"/></sitem>
<sitem><specref ref="break-before"/></sitem>
<sitem><specref ref="id"/></sitem>
<sitem><specref ref="intrusion-displace"/></sitem>
<sitem><specref ref="keep-together"/></sitem>
<sitem><specref ref="keep-with-next"/></sitem>
<sitem><specref ref="keep-with-previous"/></sitem>

<sitem><specref ref="relative-align"/></sitem>
</slist>
</div3>


<div3 id="fo_list-item-body"><head>fo:list-item-body</head>

<p><emph>Common Usage:</emph></p>
<p>The fo:list-item-body formatting object contains the
content
of the body of a list-item.</p>

<p><emph>Areas:</emph></p>
<p>The fo:list-item-body formatting object does not generate any areas.  The
fo:list-item-body formatting object returns the sequence of areas created by
concatenating the sequences of areas returned by each of the children
of the fo:list-item-body.
</p>

<p><emph>Constraints:</emph></p>
<p>The order of concatenation of the sequences of areas returned by
the children of the fo:list-item-body
is the same order as the children are ordered under the fo:list-item-body.
</p>

<p><emph>Contents:</emph></p>
<eg xml:space="preserve">
(<loc href="#block.fo.list" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">%block;</loc>)+
</eg>

<p>In addition this formatting object may have a sequence of
zero or more fo:markers as its initial children.</p>

<p><emph>The following properties apply to this formatting object:</emph></p><slist>
<sitem><specref ref="common-accessibility-properties"/></sitem>
<sitem><specref ref="id"/></sitem>
<sitem><specref ref="keep-together"/></sitem>
</slist>
</div3>


<div3 id="fo_list-item-label"><head>fo:list-item-label</head>

<p><emph>Common Usage:</emph></p>
<p>The fo:list-item-label formatting object contains the
content
of the label of a list-item, typically used to either enumerate,
identify, or adorn the list-item's body.</p>

<p><emph>Areas:</emph></p>
<p>The fo:list-item-label formatting object does not generate any areas.  The
fo:list-item-label formatting object returns the sequence of areas created by
concatenating the sequences of areas returned by each of the children
of the fo:list-item-label.
</p>

<p><emph>Constraints:</emph></p>
<p>The order of concatenation of the sequences of areas returned by
the children of the fo:list-item-label
is the same order as the children are ordered under the fo:list-item-label.
</p>

<p><emph>Contents:</emph></p>
<eg xml:space="preserve">
(<loc href="#block.fo.list" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">%block;</loc>)+
</eg>

<p>In addition this formatting object may have a sequence of
zero or more fo:markers as its initial children.</p>

<p><emph>The following properties apply to this formatting object:</emph></p><slist>
<sitem><specref ref="common-accessibility-properties"/></sitem>
<sitem><specref ref="id"/></sitem>
<sitem><specref ref="keep-together"/></sitem>
</slist>
</div3>


</div2>

<div2>
<head><spot id="link01_i6a"/>Dynamic Effects: Link and Multi Formatting Objects</head>

<div3><head>Introduction</head>
<p><spot id="link01_i6b"/>Dynamic effects,
whereby user actions (including User Agent state)
can influence the behavior and/or representation of portions of
a document, can be
achieved through the use of the formatting objects included in this
section:</p>
<ulist>
<item><p>One-directional single-target links.</p>
</item>
<item><p>The ability to switch between the display of two or more
formatting object subtrees. This can be used for, e.g.,
expandable/collapsible table of contents, display of an icon or
a full table or graphic.
</p>
</item>
<item><p>The ability to switch between different property values, such
as color or font-weight, depending on a User Agent state, such as "hover".
</p>
</item>
</ulist>

<p>The switching between subtrees is achieved by using the
following three formatting objects:
fo:multi-switch,
fo:multi-case, and
fo:multi-toggle.
The result tree structure is shown below.
</p>
<figure>
<graphic source="MultiSTree.gif" alt="Tree representation of the multi Formatting Objects" longdesc="A tree representation of multi-switch Formatting Objects showing how they fit within one another." xml:attributes="href source" show="embed" actuate="auto" xmlns:xlink="http://www.w3.org/TR/WD-xlink"/>
<figcap><p>Tree Representation of the Multi Formatting Objects</p></figcap>
</figure>
<p>The role of the fo:multi-switch is to wrap fo:multi-case
formatting objects, each containing a subtree. Each subtree is
given a name on the fo:multi-case formatting object. Activating,
for example implemented as clicking on,
an fo:multi-toggle causes a named subtree, the previous, the next, or
"any" subtree to be displayed; controlled by the "switch-to" property.
For "any", an implementation would typically
present a list of choices each labeled using the "case-title" property
of the fo:multi-case.
The initial subtree displayed is controlled by the "starting-state"
property on the fo:multi-case.</p>

<p>Switching between different property values is achieved by using the
fo:multi-properties and fo:multi-property-set formatting objects, and
the merge-property-values() function. For example, an
fo:multi-property-set can be used to specify various properties for
each of the possible values of the active-state property, and
merge-property-values() can be used to apply them on a given formatting
object.</p>

<div4><head>Examples</head>

<div5><head>Expandable/Collapsible Table of Contents</head>
<p>Input sample:</p>
<eg xml:space="preserve">
&lt;doc&gt;
  &lt;chapter&gt;&lt;title&gt;Chapter&lt;/title&gt;
    &lt;p&gt;Text&lt;/p&gt;
    &lt;section&gt;&lt;title&gt;Section&lt;/title&gt;
    &lt;p&gt;Text&lt;/p&gt;
    &lt;/section&gt;
    &lt;section&gt;&lt;title&gt;Section&lt;/title&gt;
    &lt;p&gt;Text&lt;/p&gt;
    &lt;/section&gt;
  &lt;/chapter&gt;
  &lt;chapter&gt;&lt;title&gt;Chapter&lt;/title&gt;
    &lt;p&gt;Text&lt;/p&gt;
    &lt;section&gt;&lt;title&gt;Section&lt;/title&gt;
    &lt;p&gt;Text&lt;/p&gt;
    &lt;/section&gt;
    &lt;section&gt;&lt;title&gt;Section&lt;/title&gt;
    &lt;p&gt;Text&lt;/p&gt;
    &lt;/section&gt;
  &lt;/chapter&gt;
&lt;/doc&gt;
</eg>
<p>In this example
the chapter and section titles are extracted into a table of contents
placed at the front of the result. The chapter titles are preceded
by an icon indicating either collapsed or expanded state. The section
titles are only shown in the expanded state. Furthermore, there are
links from the titles in the table of contents to the corresponding
titles in the body of the document.</p>
<p>The two states are achieved by, for each chapter title, using
an fo:multi-switch with a fo:multi-case for each state. The icon
is contained in an fo:multi-toggle with the appropriate fo:multi-case
"switch-to" property to select the other state.</p>
<p>The links in the table of contents are achieved by
adding a unique id on the title text in the body of the document
and wrapping the title text in the table of contents in an
<spot id="link01_i5b"/>fo:basic-link referring to that id.</p>
<p>XSL Stylesheet:</p>
<eg xml:space="preserve">
&lt;?xml version='1.0'?&gt;
&lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:fo="http://www.w3.org/1999/XSL/Format"
                version='1.0'&gt;

&lt;xsl:template match="doc"&gt;
  &lt;!-- create the table of contents --&gt;
  &lt;xsl:apply-templates select="chapter/title" mode="toc"/&gt;
  &lt;!-- do the document --&gt;
  &lt;xsl:apply-templates/&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match="chapter/title" mode="toc"&gt;
  &lt;fo:multi-switch&gt;
    &lt;fo:multi-case case-name="collapsed" case-title="collapsed"
    starting-state="show"&gt;
      &lt;fo:block&gt;
        &lt;fo:multi-toggle switch-to="expanded"&gt;
          &lt;fo:external-graphic href="plus-icon.gif"/&gt;
        &lt;/fo:multi-toggle&gt;
        &lt;fo:basic-link internal-destination="{generate-id(.)}"&gt;
          &lt;xsl:number level="multiple" count="chapter" format="1. "/&gt;
          &lt;xsl:apply-templates mode="toc"/&gt;
        &lt;/fo:basic-link&gt;
      &lt;/fo:block&gt;
    &lt;/fo:multi-case&gt;
    &lt;fo:multi-case case-name="expanded" case-title="expanded"
    starting-state="hide"&gt;
      &lt;fo:block&gt;
        &lt;fo:multi-toggle switch-to="collapsed"&gt;
          &lt;fo:external-graphic href="minus-icon.gif"/&gt;
        &lt;/fo:multi-toggle&gt;
        &lt;fo:basic-link internal-destination="{generate-id(.)}"&gt;
          &lt;xsl:number level="multiple" count="chapter" format="1. "/&gt;
          &lt;xsl:apply-templates mode="toc"/&gt;
        &lt;/fo:basic-link&gt;
      &lt;/fo:block&gt;
      &lt;xsl:apply-templates select="../section/title" mode="toc"/&gt;
    &lt;/fo:multi-case&gt;
  &lt;/fo:multi-switch&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match="section/title" mode="toc"&gt;
  &lt;fo:block start-indent="10mm"&gt;
    &lt;fo:basic-link internal-destination="{generate-id(.)}"&gt;
      &lt;xsl:number level="multiple" count="chapter|section" format="1.1 "/&gt;
      &lt;xsl:apply-templates/&gt;
    &lt;/fo:basic-link&gt;
  &lt;/fo:block&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match="chapter/title"&gt;
  &lt;fo:block id="{generate-id(.)}"&gt;
    &lt;xsl:number level="multiple" count="chapter" format="1. "/&gt;
    &lt;xsl:apply-templates/&gt;
  &lt;/fo:block&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match="section/title"&gt;
  &lt;fo:block id="{generate-id(.)}"&gt;
    &lt;xsl:number level="multiple" count="chapter|section" format="1.1 "/&gt;
    &lt;xsl:apply-templates/&gt;
  &lt;/fo:block&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match="p"&gt;
  &lt;fo:block&gt;
    &lt;xsl:apply-templates/&gt;
  &lt;/fo:block&gt;
&lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;
</eg>
<p>Result Instance: elements and attributes in the fo:
namespace</p>
<eg xml:space="preserve">
&lt;fo:multi-switch&gt;
  &lt;fo:multi-case case-name="collapsed" case-title="collapsed" starting-state="show"&gt;
    &lt;fo:block&gt;
      &lt;fo:multi-toggle switch-to="expanded"&gt;
        &lt;fo:external-graphic href="plus-icon.gif"&gt;
        &lt;/fo:external-graphic&gt;
      &lt;/fo:multi-toggle&gt;
      &lt;fo:basic-link internal-destination="N4"&gt;1. Chapter
      &lt;/fo:basic-link&gt;
    &lt;/fo:block&gt;
  &lt;/fo:multi-case&gt;
  &lt;fo:multi-case case-name="expanded" case-title="expanded" starting-state="hide"&gt;
    &lt;fo:block&gt;
      &lt;fo:multi-toggle switch-to="collapsed"&gt;
        &lt;fo:external-graphic href="minus-icon.gif"&gt;
        &lt;/fo:external-graphic&gt;
      &lt;/fo:multi-toggle&gt;
      &lt;fo:basic-link internal-destination="N4"&gt;1. Chapter
      &lt;/fo:basic-link&gt;
    &lt;/fo:block&gt;
    &lt;fo:block start-indent="10mm"&gt;
      &lt;fo:basic-link internal-destination="N11"&gt;1.1 Section
      &lt;/fo:basic-link&gt;
    &lt;/fo:block&gt;
    &lt;fo:block start-indent="10mm"&gt;
      &lt;fo:basic-link internal-destination="N19"&gt;1.2 Section
      &lt;/fo:basic-link&gt;
    &lt;/fo:block&gt;
  &lt;/fo:multi-case&gt;
&lt;/fo:multi-switch&gt;
&lt;fo:multi-switch&gt;
  &lt;fo:multi-case case-name="collapsed" case-title="collapsed" starting-state="show"&gt;
    &lt;fo:block&gt;
      &lt;fo:multi-toggle switch-to="expanded"&gt;
        &lt;fo:external-graphic href="plus-icon.gif"&gt;
        &lt;/fo:external-graphic&gt;
      &lt;/fo:multi-toggle&gt;
      &lt;fo:basic-link internal-destination="N28"&gt;2. Chapter
      &lt;/fo:basic-link&gt;
    &lt;/fo:block&gt;
  &lt;/fo:multi-case&gt;
  &lt;fo:multi-case case-name="expanded" case-title="expanded" starting-state="hide"&gt;
    &lt;fo:block&gt;
      &lt;fo:multi-toggle switch-to="collapsed"&gt;
        &lt;fo:external-graphic href="minus-icon.gif"&gt;
        &lt;/fo:external-graphic&gt;
      &lt;/fo:multi-toggle&gt;
      &lt;fo:basic-link internal-destination="N28"&gt;2. Chapter
      &lt;/fo:basic-link&gt;
    &lt;/fo:block&gt;
    &lt;fo:block start-indent="10mm"&gt;
      &lt;fo:basic-link internal-destination="N35"&gt;2.1 Section
      &lt;/fo:basic-link&gt;
    &lt;/fo:block&gt;
    &lt;fo:block start-indent="10mm"&gt;
      &lt;fo:basic-link internal-destination="N43"&gt;2.2 Section
      &lt;/fo:basic-link&gt;
    &lt;/fo:block&gt;
  &lt;/fo:multi-case&gt;
&lt;/fo:multi-switch&gt;

&lt;fo:block id="N4"&gt;1. Chapter
&lt;/fo:block&gt;
&lt;fo:block&gt;Text
&lt;/fo:block&gt;
&lt;fo:block id="N11"&gt;1.1 Section
&lt;/fo:block&gt;
&lt;fo:block&gt;Text
&lt;/fo:block&gt;
&lt;fo:block id="N19"&gt;1.2 Section
&lt;/fo:block&gt;
&lt;fo:block&gt;Text
&lt;/fo:block&gt;
&lt;fo:block id="N28"&gt;2. Chapter
&lt;/fo:block&gt;
&lt;fo:block&gt;Text
&lt;/fo:block&gt;
&lt;fo:block id="N35"&gt;2.1 Section
&lt;/fo:block&gt;
&lt;fo:block&gt;Text
&lt;/fo:block&gt;
&lt;fo:block id="N43"&gt;2.2 Section
&lt;/fo:block&gt;
&lt;fo:block&gt;Text
&lt;/fo:block&gt;
</eg>
</div5>

<div5><head><spot id="fo0001eg_a"/>Styling an XLink Based on the Active State</head>
<p><spot id="aj000035_36a"/>Input sample:</p>
<eg xml:space="preserve">
&lt;p&gt;Follow this &lt;xlink:mylink xmlns:xlink="http://www.w3.org/1999/xlink"
        xlink:href="http://www.w3.org/TR"
        xlink:title="An Example"
        xlink:show="new"
        xlink:actuate="onRequest"&gt;link&lt;/xlink:mylink&gt; to access all
TRs of the W3C.&lt;/p&gt;
</eg>
<p>In this example an fo:basic-link contains a series of
fo:multi-property-sets
that specify various colors or text-decorations depending on the active
state, and a wrapper around the fo:basic-link that allows for the
merging
of the properties of the fo:multi-properties with those of the
appropriate fo:multi-property-sets.</p>
<p><spot id="aj000035_36b"/>XSL Stylesheet:</p>
<eg xml:space="preserve">
&lt;?xml version='1.0'?&gt;
&lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:fo="http://www.w3.org/1999/XSL/Format"
                version='1.0'&gt;

&lt;xsl:template match="p"&gt;
    &lt;fo:block&gt;
        &lt;xsl:apply-templates/&gt;
    &lt;/fo:block&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match="xlink:mylink" xmlns:xlink="http://www.w3.org/1999/xlink"&gt;
    &lt;xsl:variable name="show"&gt;&lt;xsl:value-of select="@xlink:show"/&gt;
    &lt;/xsl:variable&gt;
     &lt;fo:multi-properties text-decoration="underline"&gt;
        &lt;fo:multi-property-set active-state="link" color="blue"/&gt;
        &lt;fo:multi-property-set active-state="visited" color="red"/&gt;
        &lt;fo:multi-property-set active-state="active" color="green"/&gt;
        &lt;fo:multi-property-set active-state="hover" text-decoration="blink"/&gt;
        &lt;fo:multi-property-set active-state="focus" color="yellow"/&gt;
        &lt;fo:wrapper color="merge-property-values()"
                    text-decoration="merge-property-values()"&gt;
              &lt;fo:basic-link external-destination="http://www.w3.org/TR"
                              show-destination="{$show}"&gt;
                  &lt;xsl:attribute name="role"&gt;
                      &lt;xsl:value-of select="@xlink:title"/&gt;
                  &lt;/xsl:attribute&gt;
                  &lt;xsl:apply-templates/&gt;
              &lt;/fo:basic-link&gt;
        &lt;/fo:wrapper&gt;
      &lt;/fo:multi-properties&gt;
&lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;
</eg>
<p><spot id="aj000035_36c"/>Result Instance: elements and attributes in the fo:
namespace</p>
<eg xml:space="preserve">
&lt;fo:block"&gt;Follow this
  &lt;fo:multi-properties text-decoration="underline"&gt;
    &lt;fo:multi-property-set active-state="link" color="blue"&gt;
    &lt;/fo:multi-property-set&gt;
    &lt;fo:multi-property-set active-state="visited" color="red"&gt;
    &lt;/fo:multi-property-set&gt;
    &lt;fo:multi-property-set active-state="active" color="green"&gt;
    &lt;/fo:multi-property-set&gt;
    &lt;fo:multi-property-set active-state="hover" text-decoration="blink"&gt;
    &lt;/fo:multi-property-set&gt;
    &lt;fo:multi-property-set active-state="focus" color="yellow"&gt;
    &lt;/fo:multi-property-set&gt;
    &lt;fo:wrapper color="merge-property-values()"
      text-decoration="merge-property-values()"&gt;
      &lt;fo:basic-link external-destination="http://www.w3.org/TR"
        show-destination="new" role="An Example"&gt;link
      &lt;/fo:basic-link&gt;
    &lt;/fo:wrapper&gt;
  &lt;/fo:multi-properties&gt; to access all
TRs of the W3C.
&lt;/fo:block&gt;
</eg>
</div5>

</div4>
</div3>


<div3 id="fo_basic-link"><head>fo:basic-link</head>

<p><emph>Common Usage:</emph></p>
<p>The fo:basic-link is used for representing the start resource of a simple
one-directional single-target link. The object allows for traversal to the
destination resource, typically by clicking on any of the containing areas.</p>

<p><emph>Areas:</emph></p>
<p>The fo:basic-link formatting object generates one or more
<term>normal</term> inline-areas.
The fo:basic-link returns these areas, any
<term>page-level-out-of-line</term> areas, and
any <term>reference-level-out-of-line</term> areas
returned by the children of the fo:basic-link.</p>
<note><p><spot id="aj000035_37"/>An fo:basic-link can be enclosed in
an fo:block to create a display area.</p>
</note>

<p><emph>Constraints:</emph></p>
<p>No area may have more than one normal child area
returned by the same fo:basic-link formatting object.</p>
<p>The children of each normal area returned by an fo:basic-link
must satisfy the constraints specified in <specref ref="area-inlinebuild"/>.
</p>

<p><emph>Contents:</emph></p>
<eg xml:space="preserve">
(#PCDATA|<loc href="#inline.fo.list" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">%inline;</loc>|<loc href="#block.fo.list" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">%block;</loc>)*
</eg>

<p>In addition this formatting object may have a sequence of
zero or more fo:markers as its initial children.<spot id="fo_11a"/></p>

<p><emph>The following properties apply to this formatting object:</emph></p><slist>
<sitem><specref ref="common-accessibility-properties"/></sitem>
<sitem><specref ref="common-aural-properties"/></sitem>
<sitem><specref ref="common-border-padding-and-background-properties"/></sitem>

<sitem><specref ref="common-margin-properties-inline"/></sitem>
<sitem><specref ref="common-relative-position-properties"/></sitem>
<sitem><specref ref="alignment-adjust"/></sitem>
<sitem><specref ref="alignment-baseline"/></sitem>
<sitem><specref ref="baseline-shift"/></sitem>
<sitem><specref ref="destination-placement-offset"/></sitem>
<sitem><specref ref="dominant-baseline"/></sitem>
<sitem><specref ref="external-destination"/></sitem>
<sitem><specref ref="id"/></sitem>
<sitem><specref ref="indicate-destination"/></sitem>
<sitem><specref ref="internal-destination"/></sitem>
<sitem><specref ref="keep-together"/></sitem>
<sitem><specref ref="keep-with-next"/></sitem>
<sitem><specref ref="keep-with-previous"/></sitem>
<sitem><specref ref="line-height"/></sitem>
<sitem><specref ref="show-destination"/></sitem>
<sitem><specref ref="target-processing-context"/></sitem>
<sitem><specref ref="target-presentation-context"/></sitem>
<sitem><specref ref="target-stylesheet"/></sitem>

</slist></div3>


<div3 id="fo_multi-switch"><head>fo:multi-switch</head>

<p><emph>Common Usage:</emph></p>
<p><spot id="aj000035_22b"/>The fo:multi-switch wraps the specification of
alternative sub-trees of formatting objects (each sub-tree
being within an fo:multi-case), and controls the switching
(activated via fo:multi-toggle) from one alternative to
another.</p>
<p>The direct children of an fo:multi-switch object are
fo:multi-case objects.
Only a single fo:multi-case may be visible at a single time. The user may
switch between the available multi-cases.</p>
<p>Each fo:multi-case may contain one or more fo:multi-toggle objects, which
controls the fo:multi-case switching of the fo:multi-switch.</p>
<note><p>An fo:multi-switch can be used for many interactive tasks, such as
table-of-content views, embedding link targets, or generalized (even
multi-layered hierarchical), next/previous views. The
latter are today
normally handled in HTML by next/previous links to other
documents, forcing
the whole document to be replaced whenever the users decides to
move on.</p>
</note>

<p><emph>Areas:</emph></p>
<p>The fo:multi-switch formatting object does not generate any areas.
The fo:multi-switch formatting object returns the sequence of
areas returned by the currently visible fo:multi-case. If there is no
currently visible fo:multi-case no areas are returned.</p>

<p><emph>Trait Derivation:</emph></p>
<p><spot id="aj000035_38"/>The <trait>currently-visible-multi-case</trait> trait
has as its initial value a reference
to the first fo:multi-case child that has a value of "show" of the
<trait>starting-state</trait> trait.  If there is no such child, it has a value
indicating that there is no currently visible fo:multi-case.
When an fo:multi-toggle is actuated, its closest ancestral
fo:multi-switch's
<trait>currently-visible-multi-case</trait> trait value changes to refer to the
fo:multi-case selected by the "switch-to" property value of the
fo:multi-toggle.  Once the <trait>currently-visible-multi-case</trait> trait
gets a value indicating that there is no currently visible fo:multi-case, it
becomes impossible to actuate an fo:multi-toggle in this fo:multi-switch.</p>

<p><emph>Constraints:</emph></p>
<p>The order of the sequence of areas returned by the fo:multi-switch
is the same as the order of the areas returned by the currently visible
fo:multi-case.</p>

<p><emph>Contents:</emph></p>
<eg xml:space="preserve">
(<loc href="#fo_multi-case" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">multi-case</loc>+)
</eg>

<p><emph>The following properties apply to this formatting object:</emph></p><slist>
<sitem><specref ref="common-accessibility-properties"/></sitem>
<sitem><specref ref="auto-restore"/></sitem>
<sitem><specref ref="id"/></sitem>
</slist>
</div3>


<div3 id="fo_multi-case"><head>fo:multi-case</head>

<p><emph>Common Usage:</emph></p>
<p><spot id="aj000035_23b"/>The fo:multi-case is used to contain (within
an fo:multi-switch) each alternative sub-tree of formatting
objects among which the parent fo:multi-switch will choose
one to show and will hide the rest.</p>

<p><emph>Areas:</emph></p>
<p>The fo:multi-case formatting object does not generate any areas.  The
fo:multi-case formatting object returns the sequence of areas created by
concatenating the sequences of areas returned by each of the children
of the fo:multi-case.
</p>

<p><emph>Constraints:</emph></p>
<p>The order of concatenation of the sequences of areas returned by
the children of the fo:multi-case
is the same order as the children are ordered under the fo:multi-case.
</p>

<p><emph>Contents:</emph></p>
<eg xml:space="preserve">
(#PCDATA|<loc href="#inline.fo.list" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">%inline;</loc>|<loc href="#block.fo.list" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">%block;</loc>)*
</eg>

<p><spot id="fo01jr_9b"/>An fo:multi-case is only permitted to have
children that would be permitted to be children
of the parent of the fo:multi-switch that is the parent of the
fo:multi-case, except that an
fo:multi-case may not contain fo:marker children.
In particular,
it can contain fo:multi-toggle objects (at any depth), which controls the
fo:multi-case switching.</p>
<p>This restriction applies recursively.</p>
<note><p>For example, an fo:multi-case whose parent
fo:multi-switch is a child of another fo:multi-case
may only have children that
would be permitted in place of the outer fo:multi-case's parent
fo:multi-switch.</p>
</note>

<p><emph>The following properties apply to this formatting object:</emph></p><slist>
<sitem><specref ref="common-accessibility-properties"/></sitem>
<sitem><specref ref="id"/></sitem>
<sitem><specref ref="starting-state"/></sitem>
<sitem><specref ref="case-name"/></sitem>
<sitem><specref ref="case-title"/></sitem>
</slist>
</div3>


<div3 id="fo_multi-toggle"><head>fo:multi-toggle</head>

<p><emph>Common Usage:</emph></p>
<p>The fo:multi-toggle is typically used to establish an area that when
actuated (for example implemented as "clicked"),
has the effect of switching from one fo:multi-case to another.
The "switch-to" property
value of the fo:multi-toggle typically matches the "case-name" property
value of the fo:multi-case to switch to.
</p>

<p><emph>Areas:</emph></p>
<p>The fo:multi-toggle formatting object does not generate any areas. The
fo:multi-toggle formatting object returns the sequence of areas created by
concatenating the sequences of areas returned by each of the children
of the fo:multi-toggle.
Each of the areas returned by the fo:multi-toggle has a <trait>switch-to</trait>
trait with the same value as on the returning fo:multi-toggle.
</p>

<p><emph>Constraints:</emph></p>
<p>The order of concatenation of the sequences of areas returned by
the children of the fo:multi-toggle
is the same order as the children are ordered under the fo:multi-toggle.
</p>
<p>Activating an area returned by an fo:multi-toggle causes a change
to the value of the <trait>currently-visible-multi-case</trait>
of the closest <spot id="aj000035_39"/>ancestor fo:multi-switch.
(See <specref ref="switch-to"/> for how
the <trait>switch-to</trait> value selects an fo:multi-case.)</p>

<p><emph>Contents:</emph></p>
<eg xml:space="preserve">
(#PCDATA|<loc href="#inline.fo.list" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">%inline;</loc>|<loc href="#block.fo.list" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">%block;</loc>)*
</eg>
<p>An fo:multi-toggle is only permitted as a descendant of an
fo:multi-case.</p>

<p><emph>The following properties apply to this formatting object:</emph></p><slist>
<sitem><specref ref="common-accessibility-properties"/></sitem>
<sitem><specref ref="id"/></sitem>
<sitem><specref ref="switch-to"/></sitem>
</slist>
</div3>


<div3 id="fo_multi-properties"><head>fo:multi-properties</head>

<p><emph>Common Usage:</emph></p>
<p>The fo:multi-properties is used to switch between two or more property sets that
are associated with a given portion of content.</p>
<note><p>An fo:multi-properties formatting object can be
used to give different
appearances to a given portion of content. For example, when
a link changes
from the not-yet-visited state to the visited-state, this
could change the
set of properties that would be used to format the content. Designers
should be careful in choosing which properties they change, because many
property changes could cause reflowing of the text which may
not be
desired in many circumstances. Changing properties such as
"color" or
"text-decoration" should not require re-flowing the text.
</p></note>
<p>The direct children of an fo:multi-properties
formatting object
is an ordered set of fo:multi-property-set formatting objects
followed by a single fo:wrapper formatting object.
The properties, specified on the fo:wrapper, that have been
specified with a value of "merge-property-values()" will take
a value that is a merger of the value on the fo:multi-properties
and the specified values on the fo:multi-property-set
formatting objects that apply.</p>

<p><emph>Areas:</emph></p>
<p>The fo:multi-properties formatting object does not generate any areas.  The
fo:multi-properties formatting object returns the sequence of areas created by
concatenating the sequences of areas returned by each of the children
of the fo:multi-properties.
</p>

<p><emph>Constraints:</emph></p>
<p>The order of concatenation of the sequences of areas returned by
the children of the fo:multi-properties
is the same order as the children are ordered under the fo:multi-properties.
</p>


<p><emph>Contents:</emph></p>
<eg xml:space="preserve">
(<loc href="#fo_multi-property-set" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">multi-property-set</loc>+,<loc href="#fo_wrapper" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">wrapper</loc>)
</eg>

<p>The properties that should take a merged value shall be specified
with a value of "merge-property-values()". This function, when applied on
an fo:wrapper
that is a direct child of an fo:multi-properties, merges the applicable
property definitions on the fo:multi-property-set siblings.
</p>

<p><emph>The following properties apply to this formatting object:</emph></p><slist>
<sitem><specref ref="common-accessibility-properties"/></sitem>
<sitem><specref ref="id"/></sitem>
</slist>
</div3>


<div3 id="fo_multi-property-set"><head>fo:multi-property-set</head>

<p><emph>Common Usage:</emph></p>
<p>The fo:multi-property-set auxiliary formatting object
is used to specify an alternative
set of formatting
properties that can be used to provide an alternate presentation of the
children flow objects of the fo:wrapper child of the
parent of this fo:multi-property-set.</p>

<p><emph>Areas:</emph></p>
<p>The fo:multi-property-set formatting object does not generate
or return any areas. It simply holds a set of traits that may
be accessed by expressions.
</p>

<p><emph>Constraints:</emph></p>
<p>None.</p>

<p><emph>Contents:</emph></p>
<eg xml:space="preserve">
EMPTY
</eg>

<p><emph>The following properties apply to this formatting object:</emph></p><slist>
<sitem><specref ref="id"/></sitem>
<sitem><specref ref="active-state"/></sitem>
</slist>
</div3>


</div2>

<div2>
<head>Out-of-Line Formatting Objects</head>

<div3><head>Introduction</head>
<div4><head>Floats</head>
<p>The fo:float formatting object is used for two distinct purposes.
First, so that during the normal placement of content, some
related content is formatted into a separate area at the beginning of
a page where it is available to be read without immediately intruding
on the reader.  The areas generated by this kind of fo:float are called
before-floats.  An fo:float is specified to generate before-floats if it
has a "float" property value of "before".  The constraints on placing
before-floats on a page are described in the <specref ref="pg-out-of-line"/>
section of this introduction and in the description of the fo:float
formatting object.</p>
<p>Second, the fo:float formatting object is used when an area
is intended to float to one side, with normal content flowing alongside
the floated area.  The areas generated by this kind of fo:float are
called side-floats.  A side-float is always made a child of the nearest
ancestor reference-area.  The edge of the reference-area towards which
the side-float floats is controlled by the value of the "float" property.</p>
<p>Flowing normal content flowing alongside side-floats is realized
by increasing the start-intrusion-adjustment or the end-intrusion-adjustment
of normal child areas of the parent reference-area of the side-float.</p>
<p>The "clear" property applies to any block-level formatting
object.  If the value of this property for a particular formatting object
is any value other than "none", then the areas generated by the block
will be positioned to ensure that their border-rectangles do not
overlap the allocation-rectangles of the applicable side-floats as determined
by the "clear" property value.</p>
</div4>
<div4><head>Footnotes</head>
<p>The fo:footnote formatting object is used to generate both
a footnote and its citation. The fo:footnote has two children,
which are both required to be present.
The first child is an fo:inline formatting object, which is formatted to
produce the footnote citation.
The second child is an fo:footnote-body formatting object
which generates the content (or body) of the footnote.</p>
<p>The actual areas generated by the descendants of the fo:footnote-body
formatting object are determined by the formatting objects that comprise the
descendant subtree. For example, the footnote could be formatted with
a label and an indented body by using the fo:list-block formatting object
within the fo:footnote-body.</p>
</div4>
<div4 id="pg-out-of-line"><head>Conditional Sub-Regions</head>
<p>The region-body has two conditional sub-regions which implicitly
specify corresponding reference-areas called <term>before-float-reference-area</term> and
<term>footnote-reference-area</term>. These reference-areas are conditionally
generated as children of the region-reference-area. The before-float-reference-area
is generated only if the page contains one or more areas with area-class "xsl-before-float".
The footnote-reference-area is generated only if the page contains one or more areas
with area-class "xsl-footnote".
</p>
<p>The conditionally generated areas borrow space in the
<term>block-progression-dimension</term> (this is "height"
when the writing-mode is "lr-tb") within the region-reference-area,
at the expense of the main-reference-area. Whether or not a conditionally generated
area is actually generated depends, additionally, on whether there
is sufficient space left in the main-reference-area.
</p>
<p>There may be limits on how much space conditionally generated areas can
borrow from the region-reference-area. It is left to the user agent
to decide these limits.
</p>
<p>The block-progression-dimension of the main-reference-area is
set equal to the block-progression-dimension of the allocation-rectangle
of the region-reference-area minus the sum of the sizes in the
block-progression-direction of the allocation-rectangles of the
conditionally generated reference-areas that were actually generated.
The main-reference-area is positioned to immediately follow the after-edge
of the allocation-rectangle of the before-float-reference-area.
This positions the after-edge of the main-reference-area to coincide
with the before-edge of the allocation-rectangle of the footnote-reference-area.
In addition to the constraints normally determined by the region-reference-area,
the <term>inline-progression-dimension</term> (this is "width"
when the writing-mode is "lr-tb") of a conditionally generated reference-area
is constrained to match the inline-progression-dimension of the main-reference-area.
</p>
<p>Each conditionally generated reference-area may additionally contain a sequence
of areas used to separate the reference-area from the main-reference-area.
The sequence of areas is the sequence returned by formatting a fo:static-content
specified in the page-sequence that is being used to format the page.</p>
<p>If there is an fo:static-content in a page-sequence whose <spot id="jm010039_a"/>"flow-name" property value is
"xsl-before-float-separator", then the areas returned by formatting the
fo:static-content are inserted in the proper order as the last children of
a before-float-reference-area that is generated using the same page-master,
provided the main-reference-area on the page is not empty.</p>
<p>If there is an fo:static-content whose <spot id="jm010039_b"/>"flow-name" property value is
"xsl-footnote-separator", then the areas returned by formatting the
fo:static-content are inserted in the proper order as the initial children of
a footnote-reference-area that is generated using the same page-master.</p>
<p>An interactive user agent may choose to create "hot links" to the footnotes
from the footnote-citation, or create "hot links" to the before-floats from
an implicit citation, instead of realizing conditional sub-regions.
</p>
<p>The generation of areas with area-class "xsl-before-float" or "xsl-footnote"
is specified in the descriptions of the formatting objects that initially
return areas with those area-classes.</p>
</div4>

<div4><head>Examples</head>

<div5><head>Floating Figure</head>
<p>Input sample:</p>
<eg xml:space="preserve">
&lt;doc&gt;
  &lt;p&gt;C'ieng pieces were made in northern towns, such as C'ieng Mai.
They were typically of tamlung weight.&lt;/p&gt;
  &lt;figure&gt;
    &lt;photo image="TH0317A.jpg"/&gt;
    &lt;caption&gt;C'ieng Tamlung of C'ieng Mai&lt;/caption&gt;
  &lt;/figure&gt;
&lt;/doc&gt;
</eg>
<p>In this example the figures are placed as floats at the before
side (top in a lr-tb writing-mode).
</p>
<p>XSL Stylesheet:</p>
<eg xml:space="preserve">
&lt;?xml version='1.0'?&gt;
&lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:fo="http://www.w3.org/1999/XSL/Format"
                version='1.0'&gt;

&lt;xsl:template match="p"&gt;
  &lt;fo:block&gt;
    &lt;xsl:apply-templates/&gt;
  &lt;/fo:block&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match="figure"&gt;
  &lt;fo:float float="before"&gt;
    &lt;xsl:apply-templates/&gt;
  &lt;/fo:float&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match="photo"&gt;
  &lt;fo:block text-align="center"&gt;
    &lt;fo:external-graphic src="{@image}"/&gt;
  &lt;/fo:block&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match="caption"&gt;
  &lt;fo:block space-before="3pt" text-align="center"
    start-indent="10mm" end-indent="10mm"&gt;
    &lt;xsl:apply-templates/&gt;
  &lt;/fo:block&gt;
&lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;
</eg>
<p>Result Instance: elements and attributes in the fo:
namespace</p>
<eg xml:space="preserve">
&lt;fo:block&gt;C'ieng pieces were made in northern towns,
such as C'ieng Mai. They were typically of tamlung weight.
&lt;/fo:block&gt;

&lt;fo:float float="before"&gt;

  &lt;fo:block text-align="center"&gt;
    &lt;fo:external-graphic src="TH0317A.jpg"&gt;
    &lt;/fo:external-graphic&gt;
  &lt;/fo:block&gt;

  &lt;fo:block space-before="3pt" text-align="center" start-indent="10mm"
    end-indent="10mm"&gt;C'ieng Tamlung of C'ieng Mai
  &lt;/fo:block&gt;

&lt;/fo:float&gt;
</eg>
</div5>

<div5><head>Footnote</head>
<p>Input sample:</p>
<eg xml:space="preserve">
&lt;doc&gt;
  &lt;p&gt;Some Pod Duang were restruck&lt;fn&gt;Berglund, A., Thai Money, from
Earliest Times to King Rama V, p. 203.&lt;/fn&gt; during the reign of King Rama V.&lt;/p&gt;
&lt;/doc&gt;
</eg>
<p>In this example the footnotes are numbered <spot id="js010055_3a"/>consecutively throughout
the document. The footnote callout is the number of the footnote,
followed by a ")", as a superscript. The footnote itself is <spot id="js010055_3b"/>formatted
using list formatting objects with the footnote number as the label
and the footnote text as the body.
</p>
<p>XSL Stylesheet:</p>
<eg xml:space="preserve">
&lt;?xml version='1.0'?&gt;
&lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:fo="http://www.w3.org/1999/XSL/Format"
                version='1.0'&gt;

&lt;xsl:template match="p"&gt;
  &lt;fo:block&gt;
    &lt;xsl:apply-templates/&gt;
  &lt;/fo:block&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match="fn"&gt;
  &lt;fo:footnote&gt;
    &lt;fo:inline font-size="0.83em" baseline-shift="super"&gt;
      &lt;xsl:number level="any" count="fn" format="1)"/&gt;
    &lt;/fo:inline&gt;
    &lt;fo:footnote-body&gt;
      &lt;fo:list-block provisional-distance-between-starts="20pt"
          provisional-label-separation="5pt"&gt;
        &lt;fo:list-item&gt;
          &lt;fo:list-item-label end-indent="label-end()"&gt;
            &lt;fo:block  font-size="0.83em"
                       line-height="0.9em"&gt;
              &lt;xsl:number level="any" count="fn" format="1)"/&gt;
            &lt;/fo:block&gt;
          &lt;/fo:list-item-label&gt;
          &lt;fo:list-item-body start-indent="body-start()"&gt;
            &lt;fo:block  font-size="0.83em"
                       line-height="0.9em"&gt;
              &lt;xsl:apply-templates/&gt;
            &lt;/fo:block&gt;
          &lt;/fo:list-item-body&gt;
        &lt;/fo:list-item&gt;
      &lt;/fo:list-block&gt;
    &lt;/fo:footnote-body&gt;
  &lt;/fo:footnote&gt;
&lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;
</eg>
<p>Result Instance: elements and attributes in the fo:
namespace</p>
<eg xml:space="preserve">
&lt;fo:block&gt;Some Pod Duang were restruck
  &lt;fo:footnote&gt;
    &lt;fo:inline font-size="0.83em" baseline-shift="super"&gt;1)
    &lt;/fo:inline&gt;
    &lt;fo:footnote-body&gt;
    &lt;fo:list-block provisional-distance-between-starts="20pt"
      provisional-label-separation="5pt"&gt;
    &lt;fo:list-item&gt;
    &lt;fo:list-item-label end-indent="label-end()"&gt;
    &lt;fo:block font-size="0.83em" line-height="0.9em"&gt;1)
    &lt;/fo:block&gt;
    &lt;/fo:list-item-label&gt;
    &lt;fo:list-item-body start-indent="body-start()"&gt;
    &lt;fo:block font-size="0.83em" line-height="0.9em"&gt;Berglund, A.,
Thai Money, from Earliest Times to King Rama V, p. 203.
    &lt;/fo:block&gt;
    &lt;/fo:list-item-body&gt;
    &lt;/fo:list-item&gt;
    &lt;/fo:list-block&gt;
    &lt;/fo:footnote-body&gt;
  &lt;/fo:footnote&gt; during the reign of King Rama V.
&lt;/fo:block&gt;
</eg>
</div5>

</div4>

</div3>


<div3 id="fo_float"><head>fo:float</head>

<p><emph>Common Usage:</emph></p>
<p>The fo:float formatting object is typically used either to cause an
image to be positioned in a separate area at the beginning of a page, or
to cause an image to be positioned to one side, with normal content
flowing around and along-side the image.</p>

<p><emph>Areas:</emph></p>
<p>The fo:float generates an optional single area with area-class
"xsl-anchor", and one or more block-areas that all share the same
area-class, which is either "xsl-before-float", "xsl-side-float" or
"xsl-normal" as specified by the "float" property. (An fo:float
generates normal block-areas if its "float" property value is "none".)</p>
<p><spot id="fo01jr_7a"/>Areas with area-class "xsl-side-float" are reference areas.</p>
<p>An area with area-class "xsl-before-float" is placed as a child
of a <spot id="fo01jr_4b"/>before-float-reference-area.</p>
<p>The optional area with area-class "xsl-anchor" is not generated if the
"float" property value is "none", or if, due to an error as described
in the constraints section, the fo:float shall be formatted as though
its "float" property was "none". Otherwise, the area with area-class
"xsl-anchor" shall be generated.</p>
<p>The area with area-class "xsl-anchor" has no children, and is an
inline-area, except where this would violate the constraints that
(a.) any area's children must be either block-areas or inline-areas,
but not a mixture, and
(b.) the children of a line-area may not consist only of anchor areas.
In the case where an inline-area would violate these
constraints, the
fo:float must instead generate a block-area.</p>

<p><emph>Constraints:</emph></p>
<p>The normal inline-area generated by the fo:float shall be placed in the area tree
as though the fo:float had a "keep-with-previous" property with value "always".
The inline-area has a length of zero for both the inline-progression-dimension
and block-progression-dimension.</p>
<p>The term <term>anchor-area</term> is used here to mean the area with area-class
"xsl-anchor" generated by the fo:float.
An area with area-class "xsl-side-float" is a <term>side-float</term>.</p>
<p>No area may have more than one child block-area with the same
area-class returned by the same
fo:float formatting object.</p>
<p>Areas with area-class "xsl-before-float" must be properly ordered within the
area tree relative to other areas with the same area-class.</p>
<p>The padding-, border-, and content-rectangles of the block-areas
generated by fo:float all coincide. That is, the padding and border
are zero at all edges of the area.</p>
<p>The following constraints apply to fo:float formatting objects that generate
areas with area-class "xsl-before-float":</p>
<ulist><item><p>It is an error if the fo:float occurs as a descendant of
<spot id="fo0001_13a"/>a flow that is not assigned to a region-body,
or of an fo:block-container that generates absolutely positioned areas.
In either case, the fo:float shall be formatted as though its "float"
property was "none".</p></item>
<item><p>A block-area with area-class "xsl-before-float"
generated by the fo:float may only be descendant from
a <spot id="fo01jr_4c"/>before-float-reference-area that is (a) descendant from a "region-reference-area"
generated using the region-master for the region to which the flow that has
the fo:float as a descendant is assigned, and (b) is descendant from the same
page containing the anchor-area, or from a page following that page.</p></item>
<item><p>The fo:float may not generate any additional block-areas
with area-class "xsl-before-float" unless the
page containing the preceding block-area generated by the fo:float
contains no other areas with area-class "xsl-before-float", has
an empty main-reference-area, and does not contain a <spot id="fo01jr_4d"/>footnote-reference-area.</p></item>
<item><p>The "clear" property does not apply.</p></item></ulist>
<p>The following constraints apply to fo:float formatting objects that generate
areas with area-class <spot id="jr_sf_a"/>"xsl-side-float":</p>
<ulist>
<item><p><spot id="fo01jr_6c"/>Each side-float is placed either as
a child of the nearest ancestor reference-area of the anchor-area
or as a child of a later reference-area in the same reference-area
chain.</p>
</item>
<item><p>Side-floats that are siblings in the area-tree may overlap
their content rectangles.</p></item>
<item><p>The description in section 9.5 of <bibref ref="CSS2"/> shall
be used to determine the formatting of the fo:float and the rendering of
normal line-areas and side-floats that are inline-overlapping,
with these <spot id="jr_sf_b"/>modifications:</p>
<ulist><item><p>All references to left and right shall be interpreted as their
corresponding writing-mode relative directions "start" and "end".
The "float" property will additionally have the writing-mode relative
values "start" and "end". </p></item>
<item><p>All references to top and bottom shall be interpreted as their
corresponding writing-mode relative directions "before" and "after".</p></item>
<item><p><spot id="fo01jr_6d"/>The phrase "current line box"
shall be interpreted to mean the
line-area containing the anchor-area generated by the float.
If the anchor-area is a block-area then the "current line box" does
not exist.</p></item>
<item><p>Side-floats derive their length in the
inline-progression-dimension intrinsically from their child areas; the
length is not determined by an explicit property value.</p></item>
<item><p><spot id="fo01jr_6e"/>A side-float may add to the
intrusion adjustment of any inline-overlapping block-area
whose nearest ancestor reference-area is the parent of the side-float.
See <specref ref="intrusadjust"/> for the description of intrusion adjustments.</p></item>
<item><p>The user agent may make its own determination,
after taking into account the intrusion adjustments caused by one
or more overlapping side-floats, that the remaining space in the
inline-progression-direction is insufficient for the next side-float
or normal block-area. The user agent may address this by causing
the next side-float or normal block-area to "clear" one of
the relevant side-floats, as described in the "clear" property
description, so the intrusion adjustment is sufficiently reduced.
Of the side-floats that could be cleared to meet this constraint,
the side-float that is actually cleared must be the one whose
after-edge is closest to the before-edge of the parent
reference-area.</p>
<note><p>The user agent may determine sufficiency of space
by using a fixed length, or by some heuristic such as whether
an entire word fits into the available space,
or by some combination, in order to handle text and images.</p>
</note>
</item>
</ulist>
</item></ulist>

<p><emph>Contents:</emph></p>
<eg xml:space="preserve">
(<loc href="#block.fo.list" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">%block;</loc>)+
</eg>
<p>An fo:float is not permitted to have an fo:float, fo:footnote
or fo:marker as a descendant.</p>
<p>Additionally, an fo:float is not permitted to have as a descendant an
fo:block-container that generates an absolutely positioned area.</p>
<p><emph>The following properties apply to this formatting object:</emph></p><slist>
<sitem><specref ref="float"/></sitem>
<sitem><specref ref="clear"/></sitem>
</slist>
</div3>


<div3 id="fo_footnote"><head>fo:footnote</head>

<p><emph>Common Usage:</emph></p>
<p>The fo:footnote is typically used to produce footnote-citations within the
region-body of a page and the corresponding footnote in a separate area
nearer the after-edge of the page.</p>

<p><emph>Areas:</emph></p>
<p>The fo:footnote formatting object does not generate any areas.
The fo:footnote formatting object returns the areas generated and
returned by its child fo:inline formatting object.</p>
<p>Additionally the fo:footnote formatting object returns the block-areas
with area class "xsl-footnote" generated by its fo:footnote-body child.
An area with area-class "xsl-footnote" is placed
as a child of a <spot id="fo01jr_4e"/>footnote-reference-area.</p>

<p><emph>Constraints:</emph></p>
<p>The term <term>anchor-area</term> is defined to mean the last area that is
generated and returned by the fo:inline child of the fo:footnote.</p>
<p>A block-area returned by the fo:footnote is only permitted as a descendant from
a <spot id="fo01jr_4f"/>footnote-reference-area that is (a) descendant from a "region-reference-area<spot id="aj000029_68"/>"
generated using the region-master for the region to which the flow that has
the fo:footnote as a descendant is assigned, and (b) is descendant from the same
page that contains the anchor-area, or from a page following the page that contains
the anchor-area.</p>
<p>The second block-area and any additional block-areas returned by an fo:footnote
must be placed on the immediately subsequent pages to the page containing the
first block-area returned by the <spot id="jm010109_52"/>fo:footnote, before any other content is placed.
If a subsequent page does not contain a region-body, the user agent must use
the region-master of the last page that did contain a region-body to hold
the additional block-areas.</p>
<p>It is an error if the fo:footnote occurs as a descendant of
<spot id="fo0001_13b"/>a flow that is not assigned to a region-body,
or of an fo:block-container
that generates absolutely positioned areas. In either case, the block-areas
generated by the fo:footnote-body child of the fo:footnote shall be returned
to the parent of the fo:footnote and placed in the area tree as though they
were normal block-level areas.</p>

<p><emph>Contents:</emph></p>
<eg xml:space="preserve">
(<loc href="#fo_inline" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">inline</loc>,<loc href="#fo_footnote-body" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">footnote-body</loc>)
</eg>

<p>An fo:footnote is not permitted to have an fo:float, fo:footnote,
or fo:marker as a descendant.</p>
<p>Additionally, an fo:footnote is not permitted to have as a descendant
an fo:block-container that generates an absolutely positioned area.</p>

<p><emph>The following properties apply to this formatting object:</emph></p><slist>
<sitem><specref ref="common-accessibility-properties"/></sitem>
</slist>
</div3>


<div3 id="fo_footnote-body"><head>fo:footnote-body</head>

<p><emph>Common Usage:</emph></p>
<p>The fo:footnote-body is used to generate the footnote content.</p>

<p><emph>Areas:</emph></p>
<p>The fo:footnote-body generates and returns one or more block-level
areas with area-class "xsl-footnote".</p>

<p><emph>Constraints:</emph></p>
<p>The fo:footnote-body is only permitted as a child of an fo:footnote.</p>
<p>No area may have more than one child block-area returned by the same
fo:footnote-body formatting object.</p>
<p>Areas with area-class "xsl-footnote" must be properly ordered within the
area tree relative to other areas with the same area-class.</p>

<p><emph>Contents:</emph></p>
<eg xml:space="preserve">
(<loc href="#block.fo.list" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">%block;</loc>)+
</eg>

<p><emph>The following properties apply to this formatting object:</emph></p><slist>
<sitem><specref ref="common-accessibility-properties"/></sitem>
</slist>
</div3>


</div2>

<div2>
<head>Other Formatting Objects</head>

<div3><head>Introduction</head>
<p>The following example shows the use of the fo:wrapper
formatting object that has no semantics but acts as a
"carrier" for inherited properties.</p>
<div4><head>Example</head>
<p>Input sample:</p>
<eg xml:space="preserve">
&lt;doc&gt;
&lt;p&gt;This is an &lt;emph&gt;important word&lt;/emph&gt; in this
sentence that also refers to a &lt;code&gt;variable&lt;/code&gt;.&lt;/p&gt;
&lt;/doc&gt;
</eg>
<p>The "emph" elements are to be presented using a
bold
font and the "code" elements <spot id="jm010109_53"/>using a Courier
font.</p>
<p>XSL Stylesheet:</p>
<eg xml:space="preserve">
&lt;?xml version='1.0'?&gt;
&lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:fo="http://www.w3.org/1999/XSL/Format"
                version='1.0'&gt;

&lt;xsl:template match="p"&gt;
  &lt;fo:block&gt;
    &lt;xsl:apply-templates/&gt;
  &lt;/fo:block&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match="emph"&gt;
  &lt;fo:wrapper font-weight="bold"&gt;
    &lt;xsl:apply-templates/&gt;
  &lt;/fo:wrapper&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match="code"&gt;
  &lt;fo:wrapper font-family="Courier"&gt;
    &lt;xsl:apply-templates/&gt;
  &lt;/fo:wrapper&gt;
&lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;
</eg>
<p>fo: element and attribute tree:</p>
<eg xml:space="preserve">
&lt;fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format"&gt;This is an
&lt;fo:wrapper font-weight="bold"&gt;important word&lt;/fo:wrapper&gt;
in this sentence that also refers to a
&lt;fo:wrapper font-family="Courier"&gt;variable&lt;/fo:wrapper&gt;.
&lt;/fo:block&gt;
</eg>
</div4>
</div3>


<div3 id="fo_wrapper"><head>fo:wrapper</head>

<p><emph>Common Usage:</emph></p>
<p>The fo:wrapper formatting object is used to
specify
inherited properties for a group of formatting objects.</p>

<p><emph>Areas:</emph></p>
<p>The fo:wrapper formatting object does not generate any areas.  The
fo:wrapper formatting object returns the sequence of areas created by
concatenating the sequences of areas returned by each of the children
of the fo:wrapper.
</p>

<p><emph>Trait Derivation:</emph></p>
<p>Except for "id",
the fo:wrapper has no properties that are directly used
by it. However, it does serve as a carrier to hold inheritable properties
that are utilized by its children.</p>

<p><emph>Constraints:</emph></p>
<p>The order of concatenation of the sequences of areas returned by
the children of the fo:wrapper
is the same order as the children are ordered under the fo:wrapper.
</p>

<p><emph>Contents:</emph></p>
<eg xml:space="preserve">
(#PCDATA|<loc href="#inline.fo.list" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">%inline;</loc>|<loc href="#block.fo.list" show="replace" actuate="user" xmlns:xlink="http://www.w3.org/TR/WD-xlink">%block;</loc>)*
</eg>

<p><spot id="fo01jr_9a"/>An fo:wrapper is only permitted to have
children that would be permitted to be children of
the parent of the fo:wrapper, with two exceptions:</p>
<ulist>
<item><p>An fo:wrapper may always have a sequence of zero or more
fo:markers as its initial children.</p></item>
<item><p>An fo:wrapper that is a child of an fo:multi-properties is
only permitted to have children that would be permitted
in place of the fo:multi-properties.</p></item>
</ulist>
<p>This restriction applies recursively.</p>
<note><p>For example an fo:wrapper that is a child of another
fo:wrapper may only have children that would be permitted to be children of the parent
fo:wrapper.</p>
</note>

<p><emph>The following properties apply to this formatting object:</emph></p><slist>
<sitem><specref ref="id"/></sitem>
</slist>
</div3>


<div3 id="fo_marker"><head>fo:marker</head>

<p><emph>Common Usage:</emph></p>
<p>The fo:marker is used in conjunction with
fo:retrieve-marker to produce running headers or footers. Typical
examples include:</p>
<ulist>
<item><p>dictionary headers showing the first and last word defined on the page.</p></item>
<item><p>headers showing the page's chapter and section titles.</p></item>
</ulist>
<p><spot id="aj000035_40"/>The fo:marker has to be an initial child
of its parent formatting object.</p>

<p><emph>Areas:</emph></p>
<p>The fo:marker does not directly produce any
area. Its children may be retrieved and formatted from within an
fo:static-content, using an fo:retrieve-marker whose
"retrieve-class-name" property value is the same as the
"marker-class-name" property value of this fo:marker.</p>

<p><emph>Constra
