Copyright© 2000 W3C® (MIT, INRIA, Keio), All Rights Reserved. W3C liability, trademark, document use and software licensing rules apply.
XSL is a language for expressing stylesheets. It consists of two parts:
a language for transforming XML documents, and
an XML vocabulary for specifying formatting semantics.
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.
This is a W3C Working Draft for review by W3C members and other interested parties. This adds additional functionality to what was described in the previous draft. It is a draft document and may be updated, replaced, or obsoleted by other documents at any time. The XSL Working Group will not allow early implementation to constrain its ability to make changes to this specification prior to final release. It is inappropriate to use W3C Working Drafts as reference material or to cite them as other than "work in progress". A list of current W3C working drafts can be found at http://www.w3.org/TR/.
This document has been produced as part of the W3C Style Activity by the XSL Working Group (members only).
Comments may be sent to xsl-editors@w3.org. Public discussion of XSL takes place on the XSL-List mailing list.
This specification defines the Extensible Stylesheet Language (XSL). XSL is a language for expressing stylesheets. Given a class of arbitrarily structured XML [W3C 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.
An XSL stylesheet processor 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 tree transformation and the second is called formatting. The process of formatting is performed by the formatter. This formatter may simply be a rendering engine inside a browser.
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.
Formatting is enabled by including formatting semantics in the result tree. Formatting semantics are expressed in terms of a catalog of classes of formatting objects. 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 letter-spacing, and widow, orphan, and hyphenation control. In XSL, the classes of formatting objects and formatting properties provide the vocabulary for expressing presentation intent.
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.
Tree transformation constructs the result tree. In XSL, this tree is called the element and attribute tree, 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 [XSLT]. A diagram depicting this conceptual process is shown below.
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.
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.
The vocabulary of formatting objects supported by XSL - the set of
fo: 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.
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.
Formatting consists of the generation of a tree of geometric areas, called the area tree. 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.
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.
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 formatting object tree.
As part of the step of objectifying, the characters that occur in the result tree are replaced by fo:character nodes. The first phase of the Unicode Bidirectional Algorithm is used to convert implicit Bidirectional mark-up to explicit nodes with the appropriate directional properties. Care is taken to insure that the introduced explicit nodes are properly nested in the formatting object tree.
The second phase in formatting is to refine the formatting object tree to produce the refined formatting object tree. 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), and (4) inheritance. Details on refinement are found in [5 Property Refinement / Resolution].
The refinement step is depicted in the diagram below.
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.
Area generation is depicted in the diagram below.
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.
This document is intended for implementors of such XSL processors. Although it can be used as a reference manual for writers of XSL style sheets, it is not tutorial in nature.
XSL builds on the prior work on Cascading Style Sheets [CSS2] and the Document Style Semantics and Specification Language [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.
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 side-bars, 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.
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, thus providing the user with an extremely powerful selection mechanism.
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.
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.
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 "space-treatment" property that controls how white-space is processed, a "line-feed" property that controls how 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.
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).
Some of the formatting objects and many of the properties in XSL come from the CSS2 specification, ensuring compatibility between the two.
There are four classes of XSL properties that can be identified as:
CSS properties by copy (unchanged from their CSS2 semantics)
CSS properties with extended values
CSS properties broken apart and/or extended
XSL only properties
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.
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.
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 side-bars; how big are these) and the rules by which the XML source content is placed into these "containers".
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 side-bars 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.
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.
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 [4 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 [7.2 XSL Areas and the CSS Box Model]. The area model provides a vocabulary for describing the relationships and space-adjustment between letters, words, lines, and blocks.
There are many 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 the languages based on these scripts.
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, see [7.21.43 "writing-mode"] for the description of the "writing-mode" property. Typically, the writing-mode value specifies two directions, 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.
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 sub- and super-scripts), etc.
Because XML, unlike HTML, has no built-in semantics, there is no built-in notion of a hypertext link. 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.
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.
The Tree Construction is described in "XSL Transformations" [XSLT].
The provisions in "XSL Transformations" form an integral part of this recommendation and are considered normative.
The XSL namespace has the URI http://www.w3.org/1999/XSL/Format.
NOTE:The
1999in the URI indicates the year in which the URI was allocated by the W3C. It does not indicate the version of XSL being used.
XSL processors must use the XML namespaces mechanism [W3C XML Names] 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.
This specification uses the prefix fo: for referring
to elements in the XSL namespace. However, XSL stylesheets are free
to use any prefix, provided that there is a namespace declaration that
binds the prefix to the URI of the XSL namespace.
An element from the XSL namespace may have any attribute not from the XSL namespace, provided that the expanded-name 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.
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.
NOTE:The conventions used for the names of XSL elements, attributes, and functions are as follows: names are all lower-case, 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.
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.
Formatting 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 area tree, 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 traits, which are to areas what properties are to formatting objects and attributes are to XML nodes. Section 4 (see [4 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.
Formatting objects are elements in the formatting-object tree, whose names are from the XSL namespace; a formatting object belongs to a class 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. Sections 6 (see [6 Formatting Objects]) and Section 7 (see [7 Formatting Properties] describe formatting objects and their properties.
Some formatting objects are block-level and others are inline-level. 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 Section 4 for detailed decriptions of these area types and directions.
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.
Central to this model of formatting is refinement. 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
propagating the various inherited values of properties (both implicitly and those with an attribute value of "inherit"),
evaluating expressions in property value specifications into actual values, which are then used to determine the value of the properties
converting relative numerics to absolute numerics,
constructing some composite properties from more than one attribute,
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 Section 5. See (see [5 Property Refinement / Resolution]).
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.
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.
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.
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.
Some formatting objects do not themselves generate areas, 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.
Areas received by an fo:root formatting object are pages, and are simply placed as children of the area tree root in the order in which they are returned, with no geometrical implications.
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 inline floats, block floats, and footnotes.
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.
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.
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.
The formatter generates an ordered tree, the area tree, which describes a geometric structuring of the output medium. The terms child, sibling, parent, descendant, and ancestor refer to this tree structure. The tree has a root node.
Each area tree node other than the root is called an area 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.
NOTE: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 font-family and font-size are the same for all the generating formatting objects.
An area has a content-rectangle, the portion in which its child areas are assigned, and optional padding and border. The diagram shows how these portions are related to one another. The outer bound of the border is called the border-rectangle, and the outer bound of the padding is called the padding-rectangle.
Each area has a set of traits, 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 formatting traits, and traits used for rendering may be called rendering traits. For the complete list of the type of traits see [C Property Index].
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.)
The traits of an area are either:
1. "directly-derived" -- The values of directly-derived traits are the computed value of a property of the same name on the generating formatting object, or
2. "indirectly-derived" -- 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.
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 [5 Property Refinement / Resolution]. This allows the process of inheritance to be described once and avoids a need to repeat information on computing values in this description.
There are two types of areas: block-areas and inline-areas. 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.
A line-area is a special kind of block-area whose children are all inline-areas. A glyph-area is a special kind of inline-area which has no child areas, and has a single glyph image as content.
Typical examples would be: a paragraph rendered by using an fo:block formatting object, which generates block-areas, and a character rendered by using an fo:character formatting object, which generates an inline-area (in fact, a glyph-area).
Associated with any area are two directions, which are derived from the generating formatting object's "writing-mode" and "reference-orientation" properties: the block-progression-direction is the direction for stacking block-area descendants of the area, and the inline-progression-direction is the direction for stacking inline-area descendants of the area. Another trait, the shift-direction, is present on inline-areas and refers to the direction in which baseline shifts are applied. Also the glyph-orientation defines the orientation of glyph-images in the rendered result.
The Boolean trait is-indent-reference, determines
whether or not an area establishes a coordinate system for
specifying indents. An area for which this trait is true
is called a reference-area.
Only a reference-area may have a block-progression-direction which is different from
that of its parent.
A reference-area may be either a
block-area or an inline-area.
A set of traits describes the position and dimensions of the area. Other traits include:
the is-first and is-last traits, which are Boolean traits
indicating the order in which areas are generated by a given
formatting object. is-first is true
for the first area (or only area) generated by a formatting object, and is-last
is true for the last area (or only area).
the amount of space outside the border-rectangle: space-before, space-after, space-start, and space-end (though some of these may be required to be zero on certain classes of area);
the thickness of each of the four sides of the padding: padding-before, padding-after, padding-start, and padding-end;
the style, thickness, and color of each of the four sides of the border: border-before, etc.; and
the background rendering of the area: background-color, etc.
NOTE:'Before', 'after', 'start', and 'end' refer to relative directions and are defined below.
a nominal-font, which identifies the font that is deemed to be used within that area.
Unless otherwise specified, the traits of an area generated by a formatting object are present, and have the same name and value on the area.
As described above, the content-rectangle 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 glyph contents or descendant areas may appear outside the content-rectangle.
Related to this is the allocation-rectangle 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 extends to the content-rectangle in the block-progression-direction and to the border-rectangle in the inline-progression-direction.
Allocation- and content-rectangles of an inline-area
For a block-area, it extends to the border-rectangle in the block-progression-direction and outside the border-rectangle in the inline-progression-direction by an amount equal to the end-indent, and in the opposite direction by an amount equal to the start-indent. The traits actual-block-progression-dimension and actual-inline-progression-dimension of an area apply to the content-rectangle.
NOTE: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.
Allocation- and content-rectangles of a block-area
The edges of a rectangle are designated as follows:
the before-edge is the edge occurring first in the block-progression-direction and perpendicular to it;
the after-edge is the edge opposite the before-edge;
the start-edge is the edge occurring first in the inline-progression-direction and perpendicular to it,
the end-edge is the edge opposite the start-edge.
The following diagram shows the correspondence between the various edge names for a mixed writing-mode example:
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. Thus the edges designated for the content-rectangle may not correspond with 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.
Each inline-area has a position-point determined by the formatter, on the start-edge of its allocation-rectangle; for a glyph-area, this is a point on the leading edge of the glyph on its preferred 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.
In the area tree, the set of areas with a given parent is ordered. The terms initial, final, preceding, and following refer to this ordering.
In any ordered tree, this sibling order extends to an ordering of the entire tree in at least two ways.
In the pre-order traversal order of a tree, the children of each node (their order unchanged relative to one another) come after the node, but before any following siblings of the node or of its ancestors.
In the post-order traversal order of a tree, the children of each node come before the node, but after any preceding siblings of the node or of its ancestors.
"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.
Given a particular order for the tree, a subset S of the tree is contiguous if for any elements A and B of S, S also contains any node that follows A and precedes B in the given order. There is a relative version of this: for a particular subset C of nodes of a tree, if S is a subset of C, then S is contiguous relative to C if for any elements A and B of S, S also contains any node of C that follows A and precedes B.
This section defines the notion of block-stacking constraints and inline-stacking constraints involving areas. These are defined as ordered relations, i.e. if A and B have a stacking constraint it does not necessarily mean that B and A have a stacking constraint.
The area-class trait is an enumerated value which is
xsl-normal for an area which is stacked with
other areas in sequence. A normally-sequenced area is an
area for which this trait is xsl-normal. Other
values mark an area as not following the main sequence (e.g., floats, footnotes and
absolutely positioned areas).
If P is a block-area, then there is a fence before P if P is a reference area or if the border-before-width or padding-before-width of P are nonzero. Similarly, there is a fence after P if P is a reference area or if the border-after-width or padding-after-width of P are nonzero.
If A and B are normally-sequenced areas, and S is a sequence of space-specifiers, it is defined that A and B have block-stacking constraint S if any of the following conditions holds:
B is a block-area which is the first normally-sequenced child of A, and S is the sequence consisting of the space-before of B.
A is a block-area which is the last normally-sequenced child of B, and S is the sequence consisting of the space-after of A.
A and B are both block-areas, and either
a. B is the next normally-sequenced sibling area of A, and S is the sequence consisting of the space-after of A and the space-before of B;
b. B is the first normally-sequenced child of a block-area P, there is no fence before P, A and P have a block-stacking constraint S', and S consists of S' followed by the space-before of B; or
c. A is the last normally-sequenced child of a block-area P, there is no fence after P, P and B have a block-stacking constraint S'', and S consists of the space-after of A followed by S''.
When A and B have a block-stacking constraint, the adjacent edges of A and B are an ordered pair defined as:
In case 1, the before-edge of the content rectangle of A and the before-edge of the allocation-rectangle of B.
In case 2, the after-edge of the content rectangle of A and the after-edge of the allocation-rectangle of B.
In case 3a, the after-edge of the allocation rectangle of A and the before-edge of the allocation-rectangle of B.
In case 3b, the first of the adjacent edges of A and P, and the before-edge of the allocation-rectangle of B.
In case 3c, the after-edge of the allocation rectangle of A and the second of the adjacent edges of P and B.
NOTE:The intention of the definition is to identify areas at any level of the tree which have only space between them.
Block-stacking constraint example
Example. 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 P and A have a block-stacking constraint, as do A and B, A and C, B and C, C and D, D and B, B and E, D and E, and E and P; these are the only pairs in the diagram having block-stacking constraints. If B had non-zero padding-after, then D and E would not have any block-stacking constraint (though B and E would continue to have a block-stacking constraint).
Inline stacking constraints. This section will define the inline-stacking-constraints between two areas, together with the notion of fence-before and fence-after. 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 block-progression-direction different from that of its parent.)
If P and Q have an inline-stacking constraint, then P has a fence before Q if P is a reference area or has non-zero border width or padding width at the first adjacent edge of P and Q. Similarly, Q has a fence after P if Q is a reference area or has non-zero border width or padding width at the second adjacent edge of P and Q.
If A and B are normally-sequenced areas, and S is a sequence of space-specifiers, it is defined that A and B have inline-stacking constraint S if any of the following conditions holds:
B is an inline-area which is the first normally-sequenced child of A, and S is the sequence consisting of the space-start of B.
A is an inline-area which is the last normally-sequenced child of B, and S is the sequence consisting of the space-end of A.
A and B are both inline-areas, and either
a. B is the next normally-sequenced sibling area of A, and S is the sequence consisting of the space-end of A and the space-start of B;
b. B is the first normally-sequenced child of an inline-area P, P has no fence after A, A and P have an inline-stacking constraint S', the inline-progression-direction of P is the same as the inline-progression-direction of the nearest common ancestor area of A and P, and S consists of S' followed by the space-start of B.
c. A is the last normally-sequenced child of a block-area P, P has no fence before B, P and B have an inline-stacking constraint S'', the inline-progression-direction of P is the same as the inline-progression-direction of the nearest common ancestor area of A and P, and S consists of the space-end of A followed by S''.
d. B is the last normally-sequenced child of an inline-area P, P has no fence after A, A and P have an inline-stacking constraint S', the inline-progression-direction of P is opposite to the inline-progression-direction of the nearest common ancestor area of A and P, and S consists of S' followed by the space-end of B.
e. A is the first normally-sequenced child of a block-area P, P has no fence before B, P and B have an inline-stacking constraint S'', the inline-progression-direction of P is opposite to the inline-progression-direction of the nearest common ancestor area of A and P, and S consists of the space-start of A followed by S''.
When A and B have an inline-stacking constraint, the adjacent edges of A and B are an ordered pair defined as:
In case 1, the start-edge of the content rectangle of A and the start-edge of the allocation-rectangle of B.
In case 2, the end-edge of the content rectangle of A and the end-edge of the allocation-rectangle of B.
In case 3a, the end-edge of the allocation rectangle of A and the start-edge of the allocation-rectangle of B.
In case 3b, the first of the adjacent edges of A and P, and the start-edge of the allocation-rectangle of B.
In case 3c, the end-edge of the allocation rectangle of A and the second of the adjacent edges of P and B.
In case 3d, the first of the adjacent edges of A and P, and the end-edge of the allocation-rectangle of B.
In case 3e, the start-edge of the allocation rectangle of A and the second of the adjacent edges of P and B.
Two areas are adjacent 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 descendants 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.
An area A begins an area P if A is a descendant of P and P and A have either a block-stacking constraint or an inline-stacking constraint. In this case the second of the adjacent edges of P and A is defined to be a leading edge in P.
Similarly, An area A ends an area P if A is a descendant of P and A and P have either a block-stacking constraint or an inline-stacking constraint. In this case the first of the adjacent edges of A and P is defined to be a trailing edge in P.
Each script has its preferred "baseline" for aligning glyphs from that script. Western scripts typically use a "alphabetic" baseline that touches at or near the bottom of capital letters. Further, for each font there is a preferred way of aligning embedded characters from different scripts, e.g. for a Western font there is a separate baseline for aligning embedded ideographic or Indic characters.
Each block-area and inline-area has a "dominant-baseline" trait which is a baseline-type, an enumerated type corresponding to the type of alignment expected for the nominal font for that area. Similarly, each inline-area has a "baseline-identifier" trait, corresponding to the type of alignment preferred for that area. The geometric line identified by this trait is called the preferred baseline of the inline-area.
Associated to each font there is a table of baseline shifts, called the baseline table, which associates to each pair of possible baseline types the distance between the corresponding baselines in that font.
Example. For a Western font, the baseline table would
associate to the pair <alphabetic, hanging> a distance
approximately equal to the ascender height of the font, representing the offset
from the alphabetic baseline of the designated alignment point for embedded hanging-aligned
characters.
Some font standards, e.g. OpenType, define a baseline table as part of the font data.
Certain baselines which are not part of the registered set of baselines are defined
as follows. The offset of the text-before-edge baseline
is determined by the height of font relative to the dominant baseline.
The determination of the text-after-edge
baseline offset is analogous; the descent of the nominal font is used for
"text-after-edge".
For each line area, the offset of the "before-edge" baseline is determined by ignoring
all inline areas whose baseline-identifier is "before-edge". The "before-edge" baseline
offset is set to the maximum extent in the direction opposite the block-progression-direction,
of the before-edges of the remaining inline-areas. If all
the inline-areas in an line area are aligned "before-edge" then use "text-before-edge" as the
"before-edge" alignment offset. The determination of the "after-edge" baseline is analogous.
For each area define two quantities, before-baseline-height and after-baseline-height, as the respective distances from the area's dominant baseline to the before-edge and after-edge baselines.
A space-specifier is a compound datatype whose components are minimum, optimum, and maximum, conditionality, and precedence.
Minimum, optimum, and maximum are lengths and can be used to define a constraint on a distance, namely that the distance should preferably be the optimum, and in any case no less than the minimum nor more than the maximum. 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.
Conditionality 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 retain and
discard;
a conditional space-specifier is one for which this value is
discard.
Precedence has a value which is either an integer or the special
token force. A forcing space-spe cifier
is one for which this value is force.
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 resolved space-specifier in accordance with their conditionality and precedence, as shown below in the space-resolution rules.
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.
To compute the resolved space-specifier of a given space-specifier S, consider the maximal inline-stacking constraint or block-stacking constraint containing S. The resolved space-specifier of S is a non-conditional space-specifier computed in terms of this sequence.
If any of the space-specifiers (in the maximal sequence) is conditional, and begins a reference-area or line-area, then it is suppressed, which means that its resolved space-specifier is zero. Further, any conditional space-specifiers which consecutively follow it in the sequence are also suppressed.
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.
If any of the remaining space-specifiers 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.
Alternatively if all of the remaining space-specifiers are non-forcing, then the resolved space-specifier is defined in terms of those space-specifiers whose precedence is 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.
Otherwise 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 as its minimum, and the least of their maximum values as its maximum, and all other space-specifiers are suppressed.
Example. Suppose the sequence of space values occurring at the
beginning of a reference-areas is: first, a space with value 10 points (that is
minimum, optimum, and maximum all equal to 10 points) and conditionality
discard; second, a space with value 4 points and
conditionality retain; and third, a space
with value 5 points and conditionality discard;
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.
The padding of a block-area does not interact with the 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.)
The border or padding at the before-edge or after-edge of a block-area may be specified as conditional. If so, then it is set to zero if its its associated edge is a leading or trailing edge in a reference-area. In this case, the border or padding is taken to be zero for purposes of the stacking constraint definitions.
Block-areas have several traits which typically affect the placement of their
children. The line-height is used in line placement calculations.
So is its dominant-glyph-height, which is the size (in the
block-progression-direction) of a glyph-area in the nominal-font of the
block-area. This depends only on
the font and not on which glyphs (or fonts) actually occur among
descendants of the block-area.
The line-stacking-strategy trait controls what kind of allocation
is used for descendant line-areas and has an enumerated value
(either font-height, max-height,
or line-height). This is all rigorously described below.
All areas have these traits,
but they only have relevance for areas which have stacked line-area children.
The space-before and space-after determine the distance between the block-area and surrounding block-areas.
A block-area which is not a line-area typically has its size in the inline-progression-direction determined by its start-indent and end-indent and by the size of its nearest ancestor reference-area. A block-area which is not a line-area typically varies its block-progression-dimension to accommodate its descendants. Alternatively the generating formatting object may specify a block-progression-dimension for the block-area.
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.
For a parent area P whose children are block-areas, P is defined to be properly stacked if all of the following conditions hold:
For each block-area which is a descendant of P, the following hold:
the before-edge and after-edge of its allocation-rectangle are parallel to the before-edge and after-edges of the content-rectangle of P,
the start-edge of its allocation-rectangle is parallel to the start-edge of the content-rectangle of R (where R is the closest ancestor reference-area of B), and offset from it by a distance equal to the block-area's start-indent plus its start-intrusion-adjustment, minus its border-start, padding-start, and space-start values, and
the end-edge of its allocation-rectangle is parallel to the end-edge of the content-rectangle of R, and offset from it by a distance equal to the block-area's end-indent plus its end-intrusion-adjustment, minus its border-end, padding-end, and space-end values.
For each pair of normally-sequenced areas B and B' in the subtree below P, if B and B' have a block-stacking constraint S, then the distance between the adjacent edges of B and B' is consistent with the constraint imposed by the resolved values of the space-specifiers in S.
NOTE:The start-intrusion-adjustment and end-intrusion-adjustment are traits used to deal with intrusions from floats in the inline-progression-direction. 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 the edges of the content-rectangle may not correspond to like-named edges of the allocation-rectangle.
Example. In the diagram, if area
A
has a space-after value of 3 points, B a
space-before
of 1 point, and C a space-before of 2 points, all
with
precedence of force, and with zero border and padding,
then the constraints will place B's
allocation-rectangle
4 points below that of A, and C's
allocation-rectangle
6 points below that
of A. Thus the 4-point gap receives the
background color
from P, and the 2-point gap before C
receives the background color from B.
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 baseline-start-point which is a point determined by the formatter, on the start-edge of its content-rectangle.
The allocation-rectangle of a line is determined by the value of the
line-stacking-strategy trait: if the
value is font-height, the allocation-rectangle is
the nominal-requested-line-rectangle, defined below; if the value is
max-height, the allocation-rectangle is the
maximum-line-rectangle, defined below; and if
the value is
line-height, the allocation-rectangle is the
per-inline-height-rectangle, defined below.
The nominal-requested-line-rectangle 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 content-rectangle of the parent block-area (as modified by typographic properties such as indents), whose before-edge is separated from the baseline-start-point by the before-baseline-height, and whose after-edge is separated from the baseline-start-point by the after-baseline-height. It has the same block-progression-dimension for each line-area child of a block-area.
The maximum-line-rectangle for a line-area has the same length as the nominal-requested-line-rectangle in the inline-progression-direction. Its block-progression-dimension 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.
Nominal and Maximum Line Rectangles
The per-inline-height-rectangle has the same length as the nominal-requested-line-rectangle in the inline-progression-direction. For each inline-area the half-leading is defined to be half the difference of its line-height minus its actual-block-progression-dimension. The expanded-rectangle 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 the half-leading. The per-inline-height-rectangle is then defined to have the minimum block-progression-dimension required to enclose both the 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.
NOTE: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.
An inline-area has its own line-height 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 line-height. An inline-area has a baseline-table
for its nominal-font. It has
a dominant-baseline trait which determines how its stacked inline-area
descendants are to be aligned.
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.
An inline-area with inline-area children has a content-rectangle which is the minimum rectangle (with sides parallel to those of the content-rectangle of its parent area) which includes the allocation-rectangles of all of its children, and which extends from its position point by at least the after-baseline-height in the block-progression-direction, and in the opposite direction by at least the before-baseline-height from its position-point (these latter quantities derived from the nominal-font of the area, as defined in section 4.2.6).
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).
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.
Inline-areas are stacked relative to a baseline, defined as follows:
1. If P is a line-area, the baseline of P is defined to be the line through the baseline-start-point which is parallel to the inline-progression-direction;
2. If P is an inline-area, the baseline of P is defined to be the line through the position-point of P which is parallel to the inline-progression-direction.
For a parent area P whose children are inline-areas, P is defined to be properly stacked if all of the following conditions hold:
For each inline-area descendant I of P, the start-edge, end-edge, before-edge and after-edge of the allocation-rectangle of I are parallel to corresponding edges of the content-rectangle of the nearest ancestor reference-area of I.
For each pair of normally-sequenced areas I and I' in the subtree below P, if I and I' have an inline-stacking constraint S, then the distance between the adjacent edges of I and I' is consistent with the constraint imposed by the resolved values of the space-specifiers in S.
For any inline-area descendant I of P, the distance in the shift-direction from the baseline of P to the position-point of I equals the distance between the dominant-baseline of P and the preferred baseline of I (as determined by the dominant-baseline-table of P), plus the sum of the baseline-shifts for I and all of its ancestors which are descendants of P. This alignment is done with respect to the line-area's dominant baseline, and not with respect to the baseline of any intermediate area.
The first summand is computed to compensate for mixed writing systems with different nominal glyph baselines, and the other summands involve deliberate baseline shifts for things like superscripts and subscripts.
The most common inline-area is a glyph-area, which contains the representation for a character in a particular font.
A glyph-area has an associated font, determined by its typographic traits, which apply to its character data.
The position-point and preferred baseline 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.
A glyph-area has no children. Its actual-block-progression-dimension and baseline-table are the same for all glyphs in a font.
This section describes tree-structure constraints on the result of formatting a fo:block or similar block-level object.
A block-level formatting-object F which constructs lines does so by constructing block-areas which it returns to its parent formatting-object, and placing areas returned to F by its child formatting-objects as children of those block-areas or of line-areas which it constructs as children of those block-areas.
For each such formatting-object F, it must be possible to form an ordered partition P consisting of ordered subsets S1, S2, ..., Sn of the normally-sequenced areas returned by the child formatting-objects, such that the following are all satisfied:
Each subset consists of a sequence of inline-areas, or of a single block-area.
The ordering of the the partition follows the ordering of the formatting-object tree. Specifically, if A is in Si and B is in Sj with i < j, or if A and B are both in the same subset Si with A before B in the subset order, then either A is returned by a preceding sibling formatting-object of B, or A and B are returned by the same formatting-object with A being returned before B.
The partitioning occurs at legal line-breaks. Specifically, if A is the last area of Si and B is the first area of Si+1, then the rules of the language and script in effect must permit a line break between A and B, within the context of all areas in Si and Si+1.
The partition follows the ordering of the Area Tree, except for certain glyph substitutions and deletions. Specifically, if B1, B2, ..., Bp are the normally-sequenced child areas of the block-area or block-areas returned by F, (ordered in the pre-order traversal order of the area tree) then there is a one-one correspondence between these child areas and the partition subsets (i.e., n = p), and for each i,
if Si consists of a single block-area then Bi is that block-area, and
if Si consists of inline-areas then
Bi is a line-area whose child areas are the
same as the inline-areas in Si, 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. Deletions occur in the case of a glyph-area with a
remove-at-line-break value of true. Insertions and substitutions may
occur because of addition of hyphens or spelling changes due to
hyphenation, or glyph image construction from syllabilification, or
ligature formation.
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
letterspacing values are zero, apply-word-spacing is false, and the
values of all other relevant traits match (i.e., color, background
traits, font traits, font-height-override-after,
font-height-override-before, glyph-orientation-horizontal,
glyph-orientation-vertical, line-height, line-height-shift-adjustment,
text-decoration, text-shadow, vertical-align).
Keep and break conditions apply to a class of areas, which are typically page-areas, column-areas, and line-areas. The appropriate class for a given condition is referred to as a context and an area in this class is a context area. As defined elsewhere in the Model, page-areas are children of the root in the area tree. Column-areas are children of page-areas. Line-areas are defined in another section.
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 mainly in terms of leading or trailing areas. If A is a descendant of P, then A is defined to be leading in P if A has no preceding sibling which is a normally-sequenced area, nor does any of its ancestor areas up to but not including P. Similarly, A is defined to be trailing in P if A has no following sibling which is a normally-sequenced area, nor does any of its ancestor areas up to but not including P. For any given formatting object, the next formatting object in the flow is the first formatting object following (in the pre-order traversal order) which generates normally-sequenced areas.
Break conditions are either break-before or break-after conditions. A break-before condition is satisfied if the first area generated by the formatting object is leading within a context area. A break-after condition depends on the next formatting object in the flow; it is satisfied if either there is no such next formatting object, or if the first area generated by that formatting object is leading in a context area.
Break conditions are imposed by the break-before and break-after properties. A
refined value of page for these traits imposes a break-condition with a context
consisting of the page-areas; a value of even-page or odd-page imposes a
break-condition with a context of even-numbered page-areas or odd-numbered
page-areas, respectively; a value of column imposes a break-condition with a
context of column-areas. A value of auto in a break-before or break-after
trait imposes no break condition.
Keep conditions are either keep-with-previous, keep-with-next, or keep-together properties. A keep-with-previous condition on an object is satisfied if the first area generated 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 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 by the formatting object are descendants of a single context area.
Keep conditions are imposed by the
keep-{with-previous,with-next,together}.within-{page,column,line} properties.
The refined value of each trait specifies the strength of the keep condition
imposed, with higher numbers being stronger than lower numbers and the value
always being stronger than all numeric values. A property with value auto
does not impose a keep condition. If a keep condition is imposed by a property
ending in .within-page, the context consists of the page-areas; if .within-column,
the column-areas, and if .within-line, the line areas.
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 satisified, then some maximal satisfiable subset must be satisfied (together with all break conditions and stronger keep conditions, if any).
During refinement the set of properties that apply to a formatting object is transformed into a set of traits 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.
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 [5.2 Shorthand Expansion]. For any property that has not been specified on the object the inherited (see [5.1.4 Inheritance]) or initial value, as applicable, is used as the effective value. The second step is to transform this property set into traits.
NOTE: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.
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-constuction 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."
The specified value of a property is determined using the following mechanisms (in order of precedence):
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".
Otherwise, if the property is inheritable, use the value of that property from the parent formatting object, generally the computed value (see below).
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 specifed on the formatting object. In general, this is an error.
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.
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".
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".
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 [5.3 Computing the Values of Corresponding Properties].
In most cases, elements inherit computed values. However, there are some properties whose specified value may be inherited (e.g., the value for the "line-height" property). In the cases where child elements do not inherit the computed value, this is described in the property definition.
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.
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 properites 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 descendents until explicitly re-set in a lower descendent); 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.
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.
NOTE:Shorthands are only included in the highest XSL conformance level; "complete".
The conformance level for each property is shown in [C.3 Property Table: Part II].
Shorthand properties do not inherit from the shorthand on the parent. Instead the individual properties that the shorthand expands into may inherit.
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:
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:
"border-style", "border-color", and "border-width" is less precise than
"border-top", "border-bottom", "border-right", and "border-left".
Processing is conceptually in the following steps:
Set the effective value of all properties to their initial values.
Process all shorthands in increasing precision.
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.
If the value of the shorthand is not "inherit": determine which individual properties are to be set, and replace the initial-value with the computed value derived from the specified value.
Process all specified individual properties.
Carry out any inheritance for properties that were not given a value other than by the first step.
NOTE:For example, if both the "background" property and the "background-color" property are specified on a given formatting object: process the "background" shorthand then process the "background-color" property.
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.
The correspondance mapping from absolute to relative property is as follows:
If the "writing-mode" specifies a block-progression-direction of "top-to-bottom": "top" maps to "before", and "bottom" maps to "after".
If the "writing-mode" specifies a block-progression-direction of "bottom-to-top": "top" maps to "after", and "bottom" maps to "before".
If the "writing-mode" specifies a block-progression-direction of "left-to-right": "left" maps to "before", and "right" maps to "after".
If the "writing-mode" specifies a block-progression-direction of "right-to-left": "left" maps to "after", and "right" maps to "before".
If the "writing-mode" specifies an inline-progression-direction of "left-to-right": "left" maps to "start", and "right" maps to "end".
If the "writing-mode" specifies an inline-progression-direction of "right-to-left": "left" maps to "end", and "right" maps to "start".
If the "writing-mode" specifies an inline-progression-direction of "top-to-bottom": "top" maps to "start", and "bottom" maps to "end".
If the "writing-mode" specifies an inline-progression-direction of "bottom-to-top": "top" maps to "end", and "bottom" maps to "start".
If the "writing-mode" specifies an inline-progression-direction of "left-to-right" for odd-numbered lines, and "right-to-left" for even-numbered lined: "left" maps to "start", and "right" maps to "end".
NOTE:"reference-orientation" is a rotation and does not influence the correspondance mapping.
The simplest class of corresponding properties are those for which there are only two variants in the correspondance, 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".
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 relative property of the same name.
Note that if both the absolute and the relative properties are not explicitly specified, then the rules for determining the specifed 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.
The (corresponding) properties that use the above rule to determine their computed value are:
border-after-color
border-before-color
border-end-color
border-start-color
border-after-style
border-before-style
border-end-style
border-start-style
border-after-width
border-before-width
border-end-width
border-start-width
padding-after
padding-before
padding-end
padding-start
The "space-before", and "space-after" properties (block-level formating 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".
There are two more properties, "end-indent" and "start-indent" (block-level formatting objects), for which the computed value may be determined by the computed value of the absolute margin properties. For these traits, the calculation of the value of the trait when the corresponding absolute property is present depends on three computed values: the computed value of the corresponding absolute property, the computed value of the corresponding "padding" property, and the computed value of the corresponding "border-width" property.
Here the term "corresponding" has been broadened to mean that if "margin-left" is the corresponding absolute property to "start-indent", then "padding-left" (and "padding-start") and "border-left-width" (and "border-start-width") are the "corresponding" "padding" and "border-width" properties.
The formulae for calculating the computed value of the "start-indent", and "end-indent" properties are as follows (where "margin-corresponding" is a variable for the corresponding absolute "margin" property):
end-indent = margin-corresponding + padding-end + border-end-width
start-indent = margin-corresponding + padding-start + border-start-width
If an absolute "margin" property is not explicity specified, these equations determine a computed value for the corresponding "margin" property given values for the three traits corresponding-indent, padding-corresponding and border-corresponding width.
Based on the writing-mode in effect for the formatting object, either the "height", "min-height", and "max-heigth" properties, or the "width", "min-width", and "max-width" properties are converted to the corresponding block-progression-dimension, or inline-progression-dimension.
The "height" properties are absolute and indicate the dimension from "top" to "bottom"; the width properties the dimension from "left" to "right".
If the "writing-mode" specifies a block-progression-direction of "top-to-bottom" or "bottom-to-top" the conversion is as follows:
If any of "height", "min-height", or "max-height" is specified:
If "height" is specified then first set:
block-progression-dimension.minimum=<height>
block-progression-dimension.optimum=<height>
block-progression-dimension.maximum=<height>
If "height" is not specified, then first set:
block-progression-dimension.minimum=auto
block-progression-dimension.optimum=auto
block-progression-dimension.maximum=auto
Then, if "min-height" is specified, reset:
block-progression-dimension.minimum=<min-height>
Then, if "max-height" is specified, reset:
block-progression-dimension.minimum=<max-height>
However, if "max-height" is specified as "none", reset:
block-progression-dimension.minimum=auto
If any of "width", "min-width", or "min-width" is specified:
If "width" is specified then first set:
inline-progression-dimension.minimum=<width>
inline-progression-dimension.optimum=<width>
inline-progression-dimension.maximum=<width>
If "width" is not specified, then first set:
inline-progression-dimension.minimum=auto
inline-progression-dimension.optimum=auto
inline-progression-dimension.maximum=auto
Then, if "min-width" is specified, reset:
inline-progression-dimension.minimum=<min-width>
Then, if "max-width" is specified, reset:
inline-progression-dimension.minimum=<max-width>
However, if "max-width" is specified as "none", reset:
inline-progression-dimension.minimum=auto
If the "writing-mode" specifies a block-progression-direction of "left-to-right" or "right-to-left" the conversion is as follows:
If any of "height", "min-height", or "max-height" is specified:
If "height" is specified then first set:
inline-progression-dimension.minimum=<height>
inline-progression-dimension.optimum=<height>
inline-progression-dimension.maximum=<height>
If "height" is not specified, then first set:
inline-progression-dimension.minimum=auto
inline-progression-dimension.optimum=auto
inline-progression-dimension.maximum=auto
Then, if "min-height" is specified, reset:
inline-progression-dimension.minimum=<min-height>
Then, if "max-height" is specified, reset:
inline-progression-dimension.minimum=<max-height>
However, if "max-height" is specified as "none", reset:
inline-progression-dimension.minimum=auto
If any of "width", "min-width", or "min-width" is specified:
If "width" is specified then first set:
block-progression-dimension.minimum=<width>
block-progression-dimension.optimum=<width>
block-progression-dimension.maximum=<width>
If "width" is not specified, then first set:
block-progression-dimension.minimum=auto
block-progression-dimension.optimum=auto
block-progression-dimension.maximum=auto
Then, if "min-width" is specified, reset:
block-progression-dimension.minimum=<min-width>
Then, if "max-width" is specified, reset:
block-progression-dimension.minimum=<max-width>
However, if "max-width" is specified as "none", reset:
block-progression-dimension.minimum=auto
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 [C.3 Property Table: Part II]. Some traits have a value that is different from the value of the property. These are classified as "Value change" in the property table. The value mapping is given below.
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.
A value of "left", or "right" is converted to the writing mode relative value as specified in the property definition.
A value of "left", or "right" is converted to the writing mode relative value as specified in the property definition.
The value is converted to one that is absolute; i.e. any local stacking context has been converted to an absolute one.
A small number of properties influence traits in a more complex manner. Detais are given below.
Issue (complex-property-mapping):
The following need more work and coordination with the area model writeup: absolute-position, background-position-horizontal/vertical, starts/ends-row, text-decoration, direction, and relative-position
These properties may set values for the start-space, and end-space traits, as decribed in the property definitions.
The direction traits on an area are indirectly derived from the "writing-mode", "direction" and "unicode-bidi" properties on the formatting object that generates the area or the formatting object ancestors of that formatting object. The exact derivation depends on the trait.
block-progression-direction trait:
Let A be the area whose traits are being determined;
Let F be the formatting object that generates area A;
Let N be the nearest ancestor formatting object, including self, to F such that N generates a reference-area that is an ancestor of A in the area tree:
Then, the block-progression-direction trait for A is set to the block-progression-direction established by the "writing-mode" property of formatting object N.
inline-progression-direction trait:
Let A be the area whose traits are being determined;
Let F be the formatting object that generates area A;
Let N be the nearest ancestor formatting object, including self, to F such that at least one of the following conditions is satisfied:
N generates a reference-area that is an ancestor to A in the area tree, or
N is a block-level formatting object and the glyph-orientation of N is either 0 or 180 degrees, in which case, the "direction" property establishes the inline-progression-direction for N, or
NOTE:The above condition is complex because direction changes in vertical text only affect the rotated non-ideographic text; that is they only affect the Latin or Arabic/Hebrew half-width characters.
N is an inline formatting object and has a "unicode-bidi" property with a value of either "embed" or "override", in which case, the "direction" property establishes an inline-progression-direction for N.
Then, the inline-progression-direction trait for A is set to the inline-progression-direction established by formatting object N. If N has both a "writing-mode" and a "direction" property that establishes the inline-progression-direction then the "direction" property's overrides that established by the "writing-mode".
The final inline-progression-direction-trait may be further modified by the formatter's application of the unicode-bidi rule, and for alternating lines in the extended international writing-modes.
shift-direction trait:
Let A be the area whose traits are being determined;
Let F be the formatting object that generates area A;
Let N be the nearest ancestor formatting object, including self, to F such that N generates a reference-area that is an ancestor of A in the area tree:
Then, the shift-direction trait for A is set to the shift-direction established by the "writing-mode" property of formatting object N.
The shift-direction-trait may be further modified by the formatter for inverted lines in the extended international writing-modes.
The "is-indent-reference" 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", and "table-cell". For all other formatting objects it is set to "false".
The case changes specified by this property are carried out during refinement by changing the value of the "character" property appropriately.
NOTE:The use of the "text-transform" property is deprecated in XSL due to its severe internationalization issues.
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.
Properties are evaluated against a property-specific context. This context provides:
A list of allowed resultant types for a property value.
Conversions from resultant expression value types to an allowed type for the property.
The current font-size value.
Conversions from relative numerics by type to absolute numerics within additive expressions.
NOTE:It is not necessary that a conversion is provided for all types. If no conversion is specified, it is an error.
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.
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.
In addition, this allows certain types like relative numerics to be resolved into absolute numerics prior to mathematical operations.
All property contexts allow conversions as specified in [5.8.12 Expression Value Conversions].
When a set of properties is being evaluated for a specific formatting object element in the formatting object element 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.
When the "font-size" property is evaluated, the current font-size for use in evaluation is the font-size of the formatting object element's parent. 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.
| [1] | Expr | ::= | AdditiveExpr | |
| [2] | PrimaryExpr | ::= | '(' Expr ')' | |
| |Numeric | ||||
| | Literal | ||||
| | Color | ||||
| | Keyword | ||||
| | EnumerationToken | ||||
| | FunctionCall |
| [3] | FunctionCall | ::= | FunctionName '(' ( Argument ( ',' Argument)*)? ')' | |
| [4] | Argument | ::= | Expr |
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.
A floating-point number can have any double-precision 64-bit format IEEE 754 value [IEEE 754]. These include a special "Not-a-Number" (NaN) value, positive and negative infinity, and positive and negative zero. See Section 4.2.3 of [JLS] for a summary of the key rules of the IEEE 754 standard.
| [5] | Numeric | ::= | AbsoluteNumeric | |
| | RelativeNumeric | ||||
| [6] | AbsoluteNumeric | ::= | AbsoluteLength | |
| [7] | AbsoluteLength | ::= | Number AbsoluteUnitName? | |
| [8] | RelativeNumeric | ::= | Percent | |
| | RelativeLength | ||||
| [9] | Percent | ::= | Number '%' | |
| [10] | RelativeLength | ::= | Number RelativeUnitName |
The following operators may be used with numerics:
+
Performs addition.
-
Performs subtraction or negation.
*
Performs multiplication.
div
Performs floating-point division according to IEEE 754.
mod
Returns the remainder from a truncating division.
NOTE:Since XML allows
-in names, the-operator (when not used as a UnaryExpr negation) typically needs to be preceded by whitespace. For example the expression10pt - 2ptmeans subtract 2 points from 10 points. The expression10pt-2ptmeans a length value of 10 with a unit of "pt-2pt".
NOTE:The following are examples of the
modoperator:
5 mod 2returns1
5 mod -2returns1
-5 mod 2returns-1
-5 mod -2returns-1
NOTE:The
modoperator is the same as the%operator in Java and ECMAScript and is not the same as the IEEE remainder operation, which returns the remainder from a rounding division.
| [11] | AdditiveExpr | ::= | MultiplicativeExpr | |
| | AdditiveExpr '+' MultiplicativeExpr | ||||
| | AdditiveExpr '-' MultiplicativeExpr | ||||
| [12] | MultiplicativeExpr | ::= | UnaryExpr | |
| | MultiplicativeExpr MultiplyOperator UnaryExpr | ||||
| | MultiplicativeExpr 'div' UnaryExpr | ||||
| | MultiplicativeExpr 'mod' UnaryExpr | ||||
| [13] | UnaryExpr | ::= | PrimaryExpr | |
| | '-' UnaryExpr |
NOTE:The effect of this grammar is that the order of precedence is (lowest precedence first):
+, -
*, div, mod
and the operators are all left associative. For example, 2*3 + 4 div 5 is equivalent to (2*3) + (4 div 5).
If a non-numeric value is used in an AdditiveExpr and there is no property context conversion from that type into an absolute numeric value, the expression is invalid and considered an error.
An absolute numeric is an absolute length which is a pair consisting of a Number and a UnitName 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.
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.
In addition, only the mod, addition, and subtraction operators require that the numerics on either side of operation be absoluted 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.
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 expect to have a single powered unit specified (e.g., 10pt).
When the final value of 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.
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.
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).
Percentages are values that are counted in 1/100 units. That is, 10%
as a percentage value is 0.10 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.
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.
A relative length is a unit-based value that is measured against the
current value of the font-size property.
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.
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 [7.7.2 "font-size"]
Strings are represented either as literals or as an enumeration token. All properties contexts allow conversion from enumeration tokens to strings. See [5.8.12 Expression Value Conversions].
A color is a set of values used to identify a particular color from a color space. Currently, only RGB colors are supported by this draft.
RGB colors are directly represented in the expression language using a hexadecimal notation. They can also be accessed through the system-color function or through conversion from a EnumerationToken via the property context.
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.
The property takes the same computed value as the property for the formatting object's parent object.
When processing an expression, whitespace (ExprWhitespace) may be allowed before or after any expression token even though it is not explicitly defined as such in the grammar. In some cases, whitespace is necessary to make tokens in the grammar lexically distinct. Essentially, whitespace should be treated as if it does not exist after tokenization of the expression has occurred.
The following special tokenization rules must be applied in the order specified to disambiguate the grammar:
If the character following an
NCName (possibly after intervening
ExprWhitespace) is
"(",
then the token must be recognized as
FunctionName.
A number terminates at the first occurrence of a non-digit character other
than ".". This allows the unit token for
length quantities to parse properly.
When an NCName immediately follows a Number, it should be recognized as a UnitName or it is an error.
The Keyword values take precedence over EnumerationToken.
If a NCName follows a numeric, it should be recognized as an OperatorName or it is an error.
| [14] | ExprToken | ::= | '(' | ')' | '%' | |
| | Operator | ||||
| | FunctionName | ||||
| | EnumerationToken | ||||
| | Number | ||||
| [15] | Number | ::= | FloatingPointNumber | |
| [16] | FloatingPointNumber | ::= | Digits ('.' Digits?)? | |
| | '.' Digits | ||||
| [17] | Digits | ::= | [0-9]+ | |
| [18] | Color | ::= | '#' AlphaOrDigits | |
| [19] | AlphaOrDigits | ::= | [a-fA-F0-9]+ | |
| [20] | Literal | ::= | '"' [^"]* '"' | |
| | "'" [^']* "'" | ||||
| [21] | Operator | ::= | OperatorName | |
| | MultiplyOperator | ||||
| | '+' | '-' | ||||
| [22] | OperatorName | ::= | 'mod' | 'div' | |
| [23] | MultiplyOperator | ::= | '*' | |
| [24] | Keyword | ::= | 'inherit' | |
| [25] | FunctionName | ::= | NCName | |
| [26] | EnumerationToken | ::= | NCName | |
| [27] | AbsoluteUnitName | ::= | 'cm' | 'mm' | 'in' | 'pt' | 'pc' | |
| [28] | RelativeUnitName | ::= | 'em' | |
| [29] | ExprWhitespace | ::= | S |
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.
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.
The following table indicates what conversions are allowed.
| Type | Allowed Conversions | Constraints |
|---|---|---|
| NCName |
| The value may be checked against a legal set of values depending on the property. |
| AbsoluteNumeric |
|
If converting to an RGB color value, it must be a legal color value from the color space. |
| RelativeLength |
|
The specific conversion to be applied is property specific and can be found in the definition of each property.
Function: numeric floor( numeric)
The floor 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.
NOTE:If it is necessary to use the floor function for a property where a unit power of one is expected, then an expressions such as: "floor(1.4in/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.
Function: numeric ceiling(numeric)
The ceiling 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.
Function: numeric round(numeric)
The round 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.
Function: numeric min( numeric , numeric)
The min function returns the minimum of the two numeric arguments. These arguments must have the same unit power.
Function: numeric max(numeric , numeric)
The min function returns the maximum of the two numeric arguments. These arguments must have the same unit power.
Function: numeric abs( numeric)
The abs functions returns the absolute value of the numeric argument. That is, if the numeric argument is negative, it returns the negation of the argument.
Function: color rgb(numeric , numeric , numeric)
The rgb 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.
Function: color system-color( NCName)
The system-color function returns a system defined color with a given name.
Function: object system-font( NCName , NCName)
The system-font funtions 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.
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)"'.
Function: object inherited-property-value(NCName)
The inherited-property-value function returns the inherited value of the property whose name matches the argument specified. It is an error if this property is not an inherited property.
The label-end function returns the calculated
label-end value for lists. See the definition of the
provisional-label-separation property.
Function: numeric body-start()
The body-start function returns the
calculated body-start value for lists.
See the definition of the
provisional-distance-between-starts
property.
NOTE:When this function is used outside of a list, it still returns a calculated value as specified.
Function: object from-parent( NCName)
The from-parent function returns a computed value of the property whose name matches the argument specified. 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; 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.
Function: object from-nearest-specified-value( NCName)
The from-nearest-specified-value function returns a computed value of the property whose name matches the argument specified. 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 formatting object element tree. 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; 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.
Function: object from-table-column( NCName)
The from-table-column function returns the inherited value of the property, whose name matches the argument specified, 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.
Certain property values are described in terms of compound datatypes, in terms of restrictions on permitted number values, or strings with particular semantics.
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 a the "space-before" property may be specified as:
space-before.minimum="2.0pt" space-before.maximum="4.0pt" space-before.optimum="3.0pt" space-before.precedence="0" space-before.conditionality="discard"
The following datatypes are defined:
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.
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.
A signed length value where a 'length' is a real number plus a unit qualification. A property may define additional constraints on the value.
A compound datatype, with components: minumum, optimum, maximum. Each component is a <length>. A property may define additional constraints on the values.
A compound datatype, with components: length, conditionality. The length component is a <length>. The conditionality component is either "discard" or "retain". A property may define additional constraints on the values.
A compound datatype, with components: block-progression-direction, and inline-progression-direction. Each component is a <length>. A property may define additional constraints on the values.
A compound datatype, with components: minumum, optimum, maximum, precedence, and conditionality. The minumum, optimum, and maximum components are <length>s. The precedence component is either "force" or an <integer>. The conditionality component is either "discard" or "retain".
A compound datatype, with components: within-line, within-column, and within-page. The value of each component is either "auto", "always", or an <integer>.
An <integer> representing an angle.
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.
A single Unicode character.
A sequence of characters.
A string of characters representing a name. It must not contain any whitespace, or space characters.
A string of characters identifying a font.
TBD
A string of characters conforming to an ISO 3166 country code.
A string of characters conforming to the ISO 639 3 letter code.
A string of characters conforming to an ISO 15924 script code.
A string of characters conforming to the XML NMTOKEN definition that is unique within the stylesheet.
A string of characters conforming to the XML NMTOKEN definition that matches an ID property value used within the stylesheet.
A sequence of characters conforming to a URI value as specified in the URI specification.
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 [3 Introduction to Formatting].The presentation is represented, abstractly, by an area tree, as defined in the area model. See [4 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.
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 flow objects. The third kind is either a layout object or an auxilliary object. 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.
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 generated-by and returned-by.
The value of the generated-by trait is a single formatting object. A formatting object F is defined to generate an area A if the semantics of F specify the generation of one or more areas and A is one of the areas thus generated.
The value of the returned-by 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.
A formatting object F is defined to return the sequence of areas A, B, C, ... if the pair (F,1) is a member of the returned-by trait of A, the pair (F,2) is a member of the returned-by trait of B, the pair (F,3) is a member of the returned-by trait of C, ...
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.
A set of nodes in a tree is a lineage if:
there is a node N in the set such that all the nodes in the set are ancestors of N, and
for every node N in the set, if the set contains an ancestor of N, it also contains the parent of N.
The set of formatting objects that an area is returned by is a lineage.
Areas returned by a formatting object may be either normal or out-of-line. 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 returned-by lineage of size one. There is only one kind of normal area.
Out-of-line areas are areas used outside the normal flow of text either because the are absolutely positioned or they are part of a float or footnote. Out-of-line areas may have a returned-by lineage of size greater than one.
The area-class 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: "normal", "absolute", "xsl-footnote", "xsl-start-float", "xsl-end-float" or "xsl-top-float". An area is normal if and only if the value of the area-class trait is "normal"; otherwise, the area is an out-of-line area.
The areas returned-by 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 area-class, such as the sub-sequence of normal areas. An area A precedes an area B in the sub-sequence if and only if area A precedes area B in the areas returned-by the formatting objects.
The content of a formatting object is described using xml content model syntax. In some cases additional constraints, not expressable in xml content models, are given in prose.
The parameter entity, "%block;" in the content models below, contains the following formatting objects:
block
block-container
table-and-caption
table
list-block
The parameter entity, "%inline;" in the content models below, contains the following formatting objects:
bidi-override
character
external-graphic
instream-foreign-object
inline
inline-container
leader
page-number
page-number-citation
simple-link
multi-toggle
The following formatting objects are "neutral" containers and may be used anywhere where #PCDATA, %block;, or %inline; are allowed:
multi-switch
multi-properties
wrapper
The following "out-of-line" formatting objects may be used anywhere where #PCDATA, %block;, or %inline; are allowed:
float
footnote
The fo:bidi-override inline formatting object is used where it is necessary to override the default Unicode-bidirectionality algorithm writing-direction for different (or nested) inline scripts in mixed-language documents.
The fo:block formatting object is commonly used for formatting paragraphs, titles, headlines, figure and table captions, etc.
The fo:block-container flow object is used to generate a block-level reference-area.
The fo:character flow object represents a character that is mapped to a glyph for presentation.
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.
The fo:external-graphic flow object is used for an inline graphic where the graphics data resides outside of the fo:element tree.
The fo:float flow object is used to gather content of a floating figure, table, or sidebar.
The content of the fo:flow formatting object is a sequence of flow objects that forms one unit of content distribution, such as an article, a chapter, or a section.
The fo:footnote formatting object is used to gather the components of a floating note.
The fo:initial-property-set specifies formatting properties for the first line of an fo:block.
The fo:inline formatting object is commonly used for formatting a portion of text with a background or enclosing it in a border.
The fo:inline-container flow object is used to generate an inline reference-area.
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.
The fo:layout-master-set is a wrapper around all masters used in the document.
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 are used for connecting two text formatting objects and split-quads (space-leaders).
The fo:list-block flow object is used to format a list item or a list.
The fo:list-item formatting object contains the label and the body of an item in a list.
The fo:list-item-body formatting object contains the content of the body of a list-item.
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.
The fo:multi-case is used to embed flow objects, that the parent fo:multi-switch can choose to either show or hide.
The fo:multi-properties is used to switch between two or more property sets that are associated with a given portion of content.
The fo:multi-property-set is used to specify an alternative set of formatting properties that, dependent on a DOM state, are applied to the content.
The fo:multi-switch is used to switch between two or more sub-trees of formatting objects.
The fo:multi-toggle is used within an fo:multi-case to switch to another fo:multi-case.
The fo:page-number formatting object is used to represent the current page-number.
The fo:page-number-citation is used to reference the page-number for the page containing the first normally sequenced area returned by the cited formatting object.
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.
The fo:page-sequence-master specifies sequences of page-masters that are used when generating a sequence of pages.
This region defines a viewport that is located on the "after" side of fo:region-body region.
This region defines a viewport that is located on the "before" side of fo:region-body region.
This region specifies a viewport that is located in the "center" of the fo:simple-page-master.
This region defines a viewport that is located on the "end" side of fo:region-body region.
This region defines a viewport that is located on the "start" side of fo:region-body region.
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.
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.
The fo:root node is the top node of an XSL result tree. This tree is composed of formatting objects.
The fo:simple-link is used for representing the start resource of a simple link.
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
An fo:single-page-master-reference specifies a sub-sequence consisting of a single instance of a single page-master.
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.
The fo:table flow object is used for formatting the tabular material of a table.
The fo:table-and-caption flow object is used for formatting a table together with its caption.
The fo:table-body formatting object is used to contain the content of the table body.
The fo:table-caption formatting object is used to contain block-level formatting objects containing the caption for the table.
The fo:table-cell formatting object is used to group content to be placed in a table-cell.
The fo:table-column formatting object specifies characteristics applicable to table cells that have the same column and span.
The fo:table-footer formatting object is used to contain the content of the table footer.
The fo:table-header formatting object is used to contain the content of the table header.
The fo:table-row formatting object is used to group table-cells into rows.
The fo:title formatting object is used to associate a title with a given page. This title may be used by an interactive User Agent to identify the page. For examle, the content of the fo:title can be formatted and displayed in a "title" window or in a "tool tip".
The fo:wrapper formatting object is used to specify inherited properties for a group of formatting objects. It has no additional formatting semantics.
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 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 flows, provide the content that is distributed into the pages. The process of generating the pages is done automatically by the XSL processor formatting the result tree.
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.
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 the smallest 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.
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).
The fo:single-page-master-reference is used to specify a sub-sequence consisting of a single page-master.
There are two ways to specify a sub-sequence that is a repetition. The fo:repeatable-page-master-reference specifies a repetition of a single page-master. The fo:repeatable-page-master-alternatives specifies the repetition of a set of page-masters. Which of the alternative page-masters is used at a given point in the sub-sequence is conditional and may depend on whether the page number is odd or even, is the first page, is the last page, or is blank. The "maximum" 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.
A page-master is a master that is used to generate a page. A page is a combination of two (nested) reference-areas: the media reference-area and the page-level reference-area. Both of these reference-areas belong to the class of block-areas.
The media reference-area is defined by the output medium; the page-level reference-area defined by the content-rectangle of the media reference-area and is a child (in the area tree) of the media reference-area. This has the affect of positioning the page-level reference-area on the output media.
NOTE:The content-rectangle of the media reference-area can be viewed as being the trim or clipping rectangle of the medium on which the page is presented. This is the trimmed size of the sheet for sheet media and the window size for display media. The content of the page-level reference-area may bleed outside the content-rectangle of the media reference-area. Bleeds are typical when the author of the content wants to insure that some of the content, usually an image, will not accidentally get a media color border when the content-rectangle of the media reference-area is not positioned exactly as intended or when its size is different than intended.
The term page is used ambiguously to refer to both the media reference-area, the page-level reference-area, or both together. The intended referent is clear from context. Most references to page will be referring either to both reference-areas or to the page-level reference-area. The media reference-area is used only when defining the position of the page-level reference-area on the output medium. Children of the page are always children of the page-level reference-area and the parent of the page is always the parent of the media reference-area. Where confusion would arise, as when distinguishing which of the two refence-areas a given trait is on, the term "page" will not be used, and, instead, the appropriate reference-area will be explicity identified.
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 generate one page for each occurrence of the reference in the specified sub-sequence.
NOTE: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.
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.
An fo:simple-page-master has, as children, specifications for one or more regions.
A region specification is used as a master, the region-master, when generating both a viewport reference-area and a region reference-area. The region reference-area is the only area child of the viewport reference-area. The viewport reference-area represents an opening in the page-level reference-area through which the region reference-area can be viewed. Scrolling and clipping is controlled in terms of the viewport reference-area.
We will say a viewport/region area corresponds to a region if the viewport reference-area/region reference-area was generated using the region-master specified by that region. Both the viewport reference-area and the region reference-area belong to the class of block-areas.
NOTE: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.
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.
The specification of the region determines the size and position of the viewport associated with the region. The positioning of the viewport is relative to the page-level reference-area that is generated using the page-master that is the parent of the region. The region reference-area takes its position from the viewport and size from the size specification of the region.
For version 1.0 of this 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 expected, that a future version of the recommendation will introduce a mechanism that allows a page-master to contain an arbitrary number of arbitrarily sized and positioned regions.
Pages are generated automatically by the formatting of fo:page-sequences. As noted above, each page is a combination of a media reference-area and a page-level reference-area. The parent of each page is the area tree root. Each page is generated by using a page-master to define the viewport areas and region reference-areas that correspond to the regions specified by that page-master.
Each fo:page-sequence references either an fo:page-sequence-master or an fo:page-master. If the reference is to an fo:page-master, this is interpreted as if it were a reference to an fo:page-sequence-master that repeats the referenced fo:page-master an unbounded number of times. We will say an fo:page-sequence references a page-master if either the fo:page-sequence directly references the page-master via the "master-name" property or that property references an fo:page-sequence-master that references the page-master.
There are two kinds of flows: fo:static-content and fo:flow. An fo:static-content flow holds content, such as the text that goes into headers and footers, that is repeated on many of the pages. The fo:flow flow holds content that is distributed across a sequence of pages. The 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.
The children of a flow are a sequence of block-level flow objects. Each flow has a name, and no two fo:flow or fo:static-content formatting objects in the same page-sequence may have the same name.
The assignment of flows to regions on a page-master is determined by an implicit flow-map. The flow-map specifies an association between the flow children of the fo:page-sequence and regions defined within the page-masters referenced by that fo:page-sequence.
In version 1.0 of XSL, 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.
To avoid requiring users to generate region-names, the regions all have default values for the "region-name" property. The region-names all begin with the prefix, "xsl-" and the suffix is the element name of the region formatting object. For example, the region that has the element name, "region-body" would have "xsl-region-body" as its default region-name.
The areas that are descendant from a page are constrained by the page-master used to generate the page and the flows that are assigned to the regions specified on the page-master. 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. 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.
There may be many area trees that would satisfy the constraints determined by the formatting objects in the result tree. There are two concepts which help choose among these trees. The first is that area trees with the least number of pages needed to meet the constraints are preferred. The second is that area trees with the least number of lines are preferred.
The areas generated by the descendants of a flow are called flow-descendant-areas.
Every flow-descendant-area is in two relationships: an area-descendant relationship and a generation-descendant relationship.
As an area, a flow-descendant-area is an immediate area descendant of its parent area in the area tree. In addition, a flow-descendant-area is, necessarily, a descendant of some page in the area tree. That is, there is some page for which the flow-descendant-area is an area-descendant.
The flow-descendant-area is also a generation-descendant of the flow that is an ancestor of the flow object that generated that area. That is, the flow objects that are the descendants of a given flow generate areas which are generation descendants of that flow.
In the sequel, the qualifiers "area" and "generation" will normally be omitted before the term "descendant" because the qualifier (and, therefore, the relationship) is implied by whether the area is described as descendant from an area or from a flow.
The result tree structure is shown below.
TBD
Common Usage:
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) 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.
NOTE: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.
Areas:
Page-level areas are returned by the fo:page-sequence children of the fo:root formatting object. The fo:root does not generate any areas.
Constraints:
The children of the root of the area tree consist solely of, and totally of, the page-level areas returned by the fo:page-sequence children of the fo:root. The ordering of area children (a) preserves the ordering of areas returned by each fo:page-sequence child and (b) orders all page-level areas returned by a given fo:page-sequence child before all of the page-level areas returned by all of its following sibling fo:page-sequences.
Contents:
(layout-master-set,page-sequence+)
Common Usage:
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. The layout of these pages comes from the fo:page-sequence-master referenced by the master-name 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.
Areas:
The fo:page-sequence formatting object generates and returns a sequence of pages. For each page, and each region specified in the page-master used to generate that page, the fo:page-sequence object also generates the viewport reference-area and region reference-area for the occurrence of that region on that page. If the region allows conditional regions within it, then the regions that are children of the region reference-area are also generated. The generation of the viewport reference-areas, the region reference-areas and their children reference-areas, if any, are described under the fo:simple-page-master and the region-masters.
Constraints:
The sequence of pages has as its descendants, in the area tree, the areas returned by the flows that are the children of the fo:page-sequence.
Each page in the page-sequence is constrained to be generated using a page-master that satisfies the constraints of the page-sequence-master identified by the master-name trait of the fo:page-sequence.
For a given page, the viewport reference-areas and region reference-areas generated for that page are constrained to correspond to the regions that are descendants of the fo:simple-page-master that was used to generate the page. In addition, for flow-descendant-areas of a given flow, the areas must be descendants of a region reference-area that corresponds to the region to which the flow was assigned. The assignment of flows to regions is discussed in Section [6.4.1.4 Flows and Flow Mapping].
There are a set of ordering constraints on the flow-descendant-areas of the pages:
We will say that a flow is assigned to a page if the flow is assigned to a region specified in the page-master that is used to generate that page.
For each page returned-by the fo:page-sequence and each fo:static-content formatting object that is a child of the fo:page-sequence, either the fo:static-content is assigned to the page or the fo:static-content is not used with that page. If the fo:static-content is not assigned to the page then none of the areas returned by the fo:static-content formatting object are flow-descendant areas of the page. If the fo:static-content is assigned to the page, then the treatment of, and constraints on, the returned areas are covered in the descriptions of the fo:simple-page-master and the associated region-masters.
For flow-descendant areas of an fo:flow formatting object,
For this version of the specification, for any two pages P and Q in the page-sequence returned by fo:page-sequence, if an fo:flow is assigned to page P, then the fo:flow must either be assigned to the same region in the page-master used to generate Q or it must not be assigned to any region in the page-master used to generate Q.
If a fo:flow is assigned to pages P and Q, and page P precedes page Q in the ordering of pages,
then all normal flow-descendant-areas of that fo:flow that are area descendants of page P must be generation ordered before all normal flow-descendant-areas of that fo:flow that are area descendants of page Q.
and, for out-of-line flow-descendant-areas of that fo:flow that are area descendants of page P and for which the value of the area-class trait is "xsl-footnote", "xsl-start-float", "xsl-end-float" and "xsl-top-float", then within each class, all flow-descendant-areas of that fo:flow that are area descendants of page P must be generation ordered before all flow-descendant-areas of that fo:flow that are area descendants of page Q.
The flow-descendant-areas descendant from a given page returned by the fo:page-sequence must, for each area-class, be contiguous relative to that area-class (see section 4.2.4 of the area model). In addition, if A and B are areas in the same area-class and if B precedes A in the sub-sequence of areas for that area-class and if B is not a flow-descendant-area of the page from which A is a descendant, then area B must be a flow-descendant area of some page that precedes that page from which A is a descendant.
NOTE:These constraints insure that all of the areas returned-by a given fo:flow are placed on some page and that the order of the areas is preserved. The normal areas are placed sequentially on sequential pages (on which the region to which that flow is assigned appears). Footnotes and floats in the block-progression-direction are also placed sequentailly, but, it is not necessary that the sequence be place in sequential pages. For example, some pages may have not footnotes or floats and a sequence of floats that is too big to fit on one page may be distributed across a sequence of pages.
Contents:
(static-content*,flow)
Properties:
Common Usage:
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.
Areas:
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.
Constraints:
The value of the master-name trait on each child of the fo:layout-master-set must be unique within the set.
Contents:
(simple-page-master|page-sequence-master)+
Common Usage:
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.
NOTE: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.
Areas:
The fo:page-sequence-master formatting object generates no area directly. It is used by the fo:page-sequence formatting object to generate pages.
Constraints:
The children of the fo:page-sequence-master are a sequence of sub-sequence-specifiers. A page-sequence satisfies the constraint determined by an fo:page-sequence-master if (a) it can be partitioned into sub-sequences of pages that map one-to-one, in order, to the sub-sequence of sub-sequence-specifiers that are the children of the fo:page-sequence specification and, (b) for each sub-sequence of pages, that sub-sequence satisfies the constraints of the corresponding sub-sequence specifier. Note that the mapping of sub-sequences of the sequence of pages to sub-sequence-specifiers need not be onto; that is, the sequence of sub-sequences of pages can be shorter than the sequence of sub-sequence-specifiers.
Contents:
(single-page-master-reference|repeatable-page-master-reference|repeatable-page-master-alternatives)+
Properties:
Common Usage:
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.
Areas:
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.
Constraints:
The fo:single-page-master-reference has a reference to the fo:simple-page-master which has the same master-name as the master-name trait on the fo:single-page-master-reference.
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.
Contents:
EMPTY
Properties:
Common Usage:
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.
Areas:
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.
Constraints:
The fo:repeatable-page-master-reference has a reference to the fo:simple-page-master which has the same master-name as the master-name trait on the fo:repeatable-page-master-reference.
The maximum-repeats trait determines how many repeats of the referenced page-master are allowed. A sub-sequence of pages that has a length that is less than or equal to the value of the maximum-repeats trait satisfies this trait; a sub-sequence of pages that has a length that is greater does not.
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 consist of zero or more pages, (b) each page is constrained to have been generated using the fo:simple-page-master referenced by the fo:repeatable-page-master-reference, and (c) the constraint determined by the maximum-repeats trait is satisfied.
Contents:
EMPTY
Properties:
Common Usage:
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.
NOTE: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.
Areas:
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.
Constraints:
The children of the fo:repeatable-page-master-alternatives are fo:conditional-page-master-references. These children will be called alternatives.
The maximum-repeats trait determines how many repeats of the referenced page-master are allowed. A sub-sequence of pages that has a length that is less than or equal to the value of the maximum-repeats trait satisfies this trait; a sub-sequence of pages that has a length that is greater does not.
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 consist of zero or more pages, (b) each page is constrained to have been 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 "true", (d) that alternative is the first alternative in the sequence of children for which all the conditions are "true", and (e) the constraint determined by the maximum-repeats trait is satisfied.
Contents:
(conditional-page-master-reference+)
Properties:
Common Usage:
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 different as well.
Areas:
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.
Constraints:
The fo:conditional-page-master-reference has a reference to the fo:simple-page-master which has the same master-name as the master-name trait on the fo:conditional-page-master-reference.
There are three traits, page-position, odd-or-even, and blank-or-not-blank that specify the sub-conditions on the use of the referenced page-master. All three sub-conditions must be "true" for the condition on the fo:conditional-page-master-reference to be "true". 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 "true", this really means that the subset of traits that are derived from properties with specified values must make the corresponding sub-condition "true".
The sub-condition corresponding to the page-position trait is "true", if the page generated using the fo:conditional-page-master-reference has the specifed position in sequence of pages generated by the referencing page-sequence; namely, "first", "last", "rest" (not first) or "any" (all of the previous). The referencing page-sequence is the fo:page-sequence that referenced the fo:page-sequence-master from which this fo:conditional-page-master-referenece is a descendant.
The sub-condition corresponding to the odd-or-even trait is "true", if the value of the "odd-or-even" 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.
The sub-condition corresponding to the blank-or-not-blank trait is "true", (1) if value of the trait is "not-blank" and the page generated using the fo:conditional-page-master-reference has flow-desecendant areas from the fo:flow formatting object; (2) if 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 flow-descendant areas of the fo:flow formatting object would not be satisfied if they were descendant from this page); or (3) if value of the trait is "any".
NOTE:If any page-master referenced from a conditional-page-master-reference with blank-or-not-blank="true" provides a region in which to put fo:flow content, no content is put in that region.
Contents:
EMPTY
Properties:
Common Usage:
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.
NOTE:For example, if the writing-mode of the fo:simple-page-master is "lr-tb", then these regions correspond to to the body of a document, the header, the footer, the left sidebar and the right sidebar.
NOTE:The simple-page-master is intended for systems that wish to provide a simple page layout facility. Future versions of this specification will support more complex page layouts constructed using the fo:page-master formatting object.
Areas:
The fo:simple-page-master formatting object generates no area directly. It is used in the generation of pages by an fo:page-sequence.
When the fo:simple-page-master is used to generate a page, two reference-areas area generated: the media reference area and the page-level reference-area. The page-level reference-area is a child of the media reference-area. The media reference-area represents the physical bounds of the output medium. The page-level reference-area represents the portion of the page on which content is intended to appear; that is, the area inside the page margins.
In addition, when the fo:simple-page-master is used to generate a page, reference-areas that correspond to the regions that are the children of the fo:simple-page-master are also generated. For each such region, the region-master is used to generate a viewport-area and a region reference-area. (See the formatting object specifications for the five regions for the details on the generation of these areas.)
Trait Derivation:
In this version of this specification, borders and padding are not allowed with a page-area. The remaining traits on the page-area are set according to normal rules for determining the values of traits.
Constraints:
When a page-master is used in the generation of a page, the height and width of the content-rectangle of the media reference-area are determined using the computed values of the "page-height" and "page-width" properties. If the "page-height" and "page-width" properties have explicit values, they are used to set the corresponding height and width trait on the media reference-area. If the "page-height" and/or "page-width" are set to "auto", the size of the media reference-area will be determined from the size of the media. If the media has a fixed size, then the size of the media is used. In the case of continuous media, the size of the user agent window is used.
NOTE:The above size calculations are intended to match the handling of a frameset in a browser window when the media is continuous and to match pages when the media is paged.
A User Agent may provide a way to declare the media for which formatting is to be done. This may be different from the media on which the formatted result is viewed. For example, a browser User Agent may be used to preview pages that are formatted for sheet media. In that case, the size calculation is based on the media for which formatting is done rather than the media being currently used.
The traits derived from the margin properties determine the size and position of the content-rectangle of the media reference-area. The traits derived from the "margin-top", "margin-bottom", "margin-left" and "margin-right" properties are used to indent the page-level reference-area content-rectangle from the corresponding edge of the media page. 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" For display media, the display window is always upright; the top of the display screen is "top".
NOTE:The reference points for the media reference-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 writing-mode currently in use.
The fo:simple-page-master may have an fo:title formatting object as a child. The user agent may use this information to help identify the page, for example, present the information in its "title bar".
The value of the page-number trait on the first page returned by the fo:page-sequence is constrained to equal the value of the initial-page-number trait. The value of the page-number trait on subsequent pages is constrained to be one greater than the value on the immediately preceding page.
The format, letter-value, grouping-separator, grouping-size, country, and language 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.
Constraints applicable to regions:
There are a number of constraints that apply to all the regions that are specified within a given fo:simple-page-master.
Flow-descendant-areas descendant from the region reference-area must also be generation descendant from the flow assigned to the region-master used to generate the region reference-area. In addition, the sub-sequence of normal areas returned by the flow object assigned to the corresponding region and descendant from the region reference area (or in the case of the fo:region-body from the remaining region-body reference-area) must be properly stacked in that reference-area.
The inline-progression-dimension of the region reference-area that corresponds to a given region-master is determined by the "inline-progression-dimension" property on the flow object that is assigned to the corresponding region. If the value of the "inline-progression-dimension" property is "auto", then the inline-progression-dimension of the region reference-area is determined from the inline-progression-dimension of the corresponding viewport reference-area. (See each region-master for further information on how the inline-progression-dimension of the corresponding viewport reference-area is determined.) Otherwise, the inline-progression-dimension of the region reference-area is taken from the inline-progression-dimension of the flow object.
If the block-progression-dimension of the properly stacked region reference-area is less than or equal to the block-progression-dimension of the viewport reference-area that is its parent, then the padding-after trait of the region reference-area shall be such that the block-progression-dimension of the content rectangle of the region reference-area plus the padding-after of that area equal the block-progression-dimension of the viewport reference-area.
NOTE:Adding padding after the content-rectangle of the region reference-area insures that the background of the region reference-area will fill the entire viewport.
If the block-progression-dimension of the properly stacked region reference-area is greater than the block-progression-dimension of the viewport reference-area that is its parent, then the constraints on the relationship between the viewport reference-area and the region reference area depend on values of the overflow trait on the region formatting object and the kind of flow assigned to the region.
If the flow assigned to the corresponding region is an fo:static-content flow object, then
If the value of the overflow trait is "scroll" or "visible", then there is no constraint on the block-progression-dimension of the region reference-area.
If the value of the overflow trait is "hidden", then the block-progression-dimension of the region reference-area is constrained to be no greater than the block-progression-dimension of the viewport reference-area.
If the flow assigned to the corresponding region is an fo:flow formatting object, then
If the value of the overflow trait is "scroll", then there is no constraint on the block-progression-dimension of the region reference-area.
If the value of the overflow trait is "hidden"or "visible", then the block-progression-dimension of the region reference-area is constrained to be no greater than the block-progression-dimension of the viewport reference-area.
The block-progression-dimension of a region-area that corresponds to a given region-master depends on the value of the overflow trait on that region-master.
Contents:
(title?,region-body,region-before?,region-after?,region-start?,region-end?)
Properties:
Common Usage:
The fo:title formatting object is used to associate a title with a given page. This title may be used by an interactive User Agent to identify the page. For examle, the content of the fo:title can be formatted and displayed in a "title" window or in a "tool tip".
Areas:
This formatting object returns the sequence of areas returned by the flow children of this formatting object.
Constraints:
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.
Contents:
((%inline;)*(%inline;))+
Properties:
Common Usage:
Used in constructing a simple-page-master. This region specifies a viewport that is located in the "center" of the fo:simple-page-master. The overflow trait controls how much of the underlying region reference-area is visible; that is, is the reference-area clipped by the viewport-area that corresponds to the region-master or not.
NOTE:Typically, for paged media, the flow-descendant-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 pages for which the page-master included an fo:region-body. For continuous media, the flow-descendant areas all descend from a single region reference-area that usually corresponds to the region-body. If the fo:flow flow is assigned to some other region, then its flow-descendant-areas are constrained to be descendants of region reference-areas that correspond to the assigned region.
NOTE:The body region should be sized and positioned within the content-rectangle of the fo:simple-page-master so that there is room for the flow-descendant-areas from 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 media reference-area. The margins on the fo:region-body are used to position the viewport-area for the fo:region-body and to leave space for the other regions that surround the fo:region-body.
![]()
The spacing between the last four regions and the fo:region-body is determined by subtracting the relevant extent trait on the side regions from the trait that corresponds to the "margin-x" property on the fo:region-body.
The fo:region-body may be also be used to provide multiple columns. When the column-count trait is greater than one, then the region-body will be subdivided into multiple columns.
Areas:
The fo:region-body formatting object is used to generate one viewport reference-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 overflow trait is "scroll".
The position and size of the viewport-area is specified relative to the content-rectangle of the page-level reference-area generated by fo:simple-page-master. The content-rectangle of the viewport-area is indented from the content-rectangle of the page-level reference-area by the values of the "margin-top", "margin-bottom", "margin-left" and "margin-right" properties. In this version of this specification, the values of the padding and border-width traits must be "0".
The region reference-area generated using an fo:region-body is a child of the viewport-area. The reference-orientation 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 reference-area generated by fo:simple-page-master (and, therefore, relative to the viewport positioned in that latter coordinate system).
In addition to the the viewport reference-area and its descendant region reference-area, when the region-body is used to generate areas, at least one and up to three additional reference-areas are generated. These reference-areas correspond to the conditional reference-area for "xsl-top-float"s, the conditional reference-area for "xsl-footnote"s and the remaining region-body reference-area. The latter reference-area comprises the space left after space is borrowed for the two conditional reference-areas. The remaining region-body reference-area has no padding, border, or space associated with it.
NOTE:If there are no conditional regions that are children of the region-body reference area, then the content rectangle of the remaining region-body reference-area is co-terminus with the content rectangle of the region-body region reference area. If there are conditional reference areas that are children of the region-body region reference-area, then the content rectangle of the remaining region-body reference-area is reduced by the space consumed by the conditional reference-areas.
Types of areas when column-count is greater than 1:
If the column-count trait has a value other than 1, for example, N, then N additional reference-areas are generated as children of the remaining region-body reference-area generated using the fo:region-body. These N reference-areas are the column reference-areas.
It is an error to specify "column-count" other than "1" if the "overflow" property has the value "scroll". Other valus will be interpreted as if "1" had been specified.
The inline-progression-dimension of each of these column reference-areas is determined by subtracting (N-1) times the column-gap trait from the inline-progression-dimension of the remaining region-body reference-area generated using the fo:region-body and dividing that result by N. Using "body-in-size" for the name of the inline-progression-dimension of the remaining region-body reference-area and "column-in-size" for the name of the size of the column reference-areas in the inline-progression-direction, the formula is:
column-in-size = (body-in-size - (N - 1)*column-gap)/N
The size of the column reference-areas in the block-progression-direction is the same as the size of the containing reference-area in the block-progression-direction.
NOTE:As noted above, the size of the containing reference-area in the block-progression direction may be less than the size of the region reference-area if conditional reference-areas are children of the region reference-area.
The column reference-areas are positioned within the reference-area generated by the fo:region-body as follows: The first column is positioned with its before-edge and start-edge coincident with the before-edge and start-edge of the remaining region-body reference-area. The Jth column reference-area is positioned with its before-edge coincident with the before-edge of the remaining region-body reference-area and with is start-edge at ((J-1)*(column-in-size + column-gap)) in the inline-direction. This results in the end-edge of the Nth column reference-area being coincident with the end-edge of the remaining region-body reference-area.
NOTE:If the writing-mode 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"writing-mode.
Trait Derivation:
The reference-orientation of the viewport reference-area is taken from the value the reference-orientation trait on the region-master which specifies the region. reference-orientation of the region reference-area is set to "0" and is, therefore,the same as the orientation established by the viewport reference-area.
Constraints:
The constraints applicable to all regions (see fo:simple-page-master) all apply.
The inline-progression-dimension of the viewport reference-area is determined by the inline-progression-dimension of the content-rectangle for the page-level reference area minus the values of the start-indent and end-indent traits of the region-master. The start-edge and end-edge of the region-master are determined by the reference-orientation trait on the page-master.
The block-progression-dimension of the viewport reference-area is determined by the block-progression-dimension of the content-rectangle for the page-level reference area minus the values of the space-before and space-after traits of the region-master. The before-edge and after-edge of the region-master are determined by the reference-orientation trait on the page-master.
The values of the space-before and start-indent traits are used to position the viewport reference-area relative to the page-level reference-areas before-edge and start-edge.
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 the description of fo:simple-page-master.
If the remaining region-body reference-area is subdivided into more than one column, then for any two coluns C and D:
If column C precedes column D in the ordering of columns,
then all normal flow-descendant-areas of that fo:flow that are area descendants of page P must be generation ordered before all normal flow-descendant-areas of that fo:flow that are area descendants of page Q.
and, for out-of-line flow-descendant-areas of that fo:flow that are area descendants of page P and for which the value of the area-class trait is "xsl-footnote", "xsl-start-float", "xsl-end-float" and "xsl-top-float", then within each class, all flow-descendant-areas of that fo:flow that are area descendants of page P must be generation ordered before all flow-descendant-areas of that fo:flow that are area descendants of page Q.
NOTE:This is sometimes called, "snaking columns".
Contents:
EMPTY
Properties:
Common Usage:
Used in constructing a simple-page-master. This region defines a viewport that is located on the "before" side of the page-level reference-area. In lr-tb writing-mode, this region corresponds to the header region. The visibility of the content that is bound to the region by an fo:page-sequence is controlled by the overflow trait on the region.
Areas:
The fo:region-before formatting object is used to generate one viewport reference-area and one region reference-area.
This viewport is positioned with its before edge coincident with the before edge of the content-rectangle of the page-level reference-area generated using the parent fo:simple-page-master. In the direction perpendicular to the before edge, the size of the viewport is determined by the extent trait on the fo:region-before formatting object.
In the direction parallel to the before edge, the size of the viewport is determined by the precedence trait on the fo:region-before. If the value of the precedence trait is "true", then the region-before viewport extends up to the start and after edges of the content rectangle of the page-level reference-area. In this case, the area generated by the region-before acts like a float into areas generated by the region-start (respectively, the region-end). If the value of the precedence trait on the fo:region-before is "false", 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.
The reference-area generated by fo:region-before lies on a canvas underneath the above viewport. The reference-orientation trait is used to orient the coordinate system of the reference-area generated by the fo:region-before relative to the coordinate system of the reference-area generated by fo:simple-page-master (and, therefore, the viewport positioned in that latter coordinate system).
The size of the reference-area depends on the setting of the overflow trait on the region. If the value of that trait is "auto", "hidden" or "visible" then the size of the area container is the same as the size of the viewport. If the value of the overflow trait is "scroll", the size of the reference-area is equal to the size of the viewport in the inline-progression-direction in the writing-mode for the region and is long enough in the block-progression-direction to hold the distribution of all the content bound to the region.
Constraints:
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 the description of fo:simple-page-master.
Contents:
EMPTY
Properties:
Common Usage:
Used in constructing a simple-page-master. This region defines a viewport that is located on the "after" side of the page-level reference-area. In lr-tb writing-mode, this region corresponds to the footer region. The visibility of the content that is bound to the region by an fo:page-sequence is controlled by the overflow trait on the region.
Areas:
The fo:region-after formatting object is used to generate one viewport reference-area and one region reference-area.
This viewport is positioned with its after edge coincident with the after edge of the content-rectangle of the page-level reference-area generated using the parent fo:simple-page-master. In the direction perpendicular to the after edge, the size of the viewport is determined by the extent trait on the fo:region-after formatting object.
In the direction parallel to the after edge, the size of the viewport is determined by the precedence trait on the fo:region-after. If the value of the precedence trait is "true", then the region-after viewport extends up to the start and after edges of the content rectangle of the page-level reference-area. In this case, the area generated by the region-after acts like a float into areas generated by the region-start (respectively, the region-end). If the value of the precedence trait on the fo:region-after is "false", 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.
The reference-area generated by fo:region-after lies on a canvas underneath the above viewport. The reference-orientation trait is used to orient the coordinate system of the reference-area generated by the fo:region-after relative to the coordinate system of the reference-area generated by fo:simple-page-master (and, therefore, the viewport positioned in that latter coordinate system).
The size of the reference-area depends on the setting of the overflow trait on the region. If the value of that trait is "auto", "hidden" or "visible" then the size of the reference-area is the same as the size of the viewport. If the value of the overflow trait is "scroll", the size of the reference-area is equal to the size of the viewport in the inline-progression-direction in the writing-mode for the region and is long enough in the block-progression-direction to hold the distribution of all the content bound to the region.
Constraints:
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 the description of fo:simple-page-master.
Contents:
EMPTY
Properties:
Common Usage:
Used in constructing a simple-page-master. This region defines a viewport that is located on the "start" side of the page-level reference-area. In lr-tb writing-mode, this region corresponds to a left sidebar. The visibility of the content that is bound to the region by an fo:page-sequence is controlled by the overflow trait on the region.
Areas:
The fo:region-start formatting object is used to generate one viewport reference-area and one region reference-area.
This viewport is positioned with its start edge coincident with the start edge of the content-rectangle of the page-level reference-area generated using the parent fo:simple-page-master. In the direction perpendicular to the start edge, the size of the viewport is determined by the extent trait on the fo:region-start formatting object.
In the direction parallel to the start edge, the size of the viewport is determined by the precedence trait on the adjacent fo:region-before and the fo:region-after. If the value of the precedence trait is "false", then the region-start viewport extends up to the before (or, respectively, after) edge of the content-rectangle of the page-level reference-area. In this case, the area generated by the region-start acts like a float into areas generated by the region-before (respectively, the region-after). If the value of the precedence trait on the adjacent regions is "true", 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 precedence trait equal to "true".
The reference-area generated by fo:region-start lies on a canvas underneath the above viewport. The reference-orientation trait is used to orient the coordinate system of the reference-area generated by the fo:region-start relative to the coordinate system of the reference-area generated by fo:simple-page-master (and, therefore, the viewport positioned in that latter coordinate system).
The size of the reference-area depends on the setting of the overflow trait on the region. If the value of that trait is "auto", "hidden" or "visible" then the size of the area container is the same as the size of the viewport. If the value of the overflow trait is "scroll", the size of the reference-area is equal to the size of the viewport in the inline-progression-direction in the writing-mode for the region and is long enough in the block-progression-direction to hold the distribution of all the content bound to the region.
Constraints:
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 the description of fo:simple-page-master.
Contents:
EMPTY
Properties:
Common Usage:
Used in constructing a simple-page-master. This region defines a viewport that is located on the "end" side of the page-level reference-area. In lr-tb writing-mode, this region corresponds to a right sidebar. The visibility of the content that is bound to the region by an fo:page-sequence is controlled by the overflow trait on the region.
Areas:
The fo:region-end formatting object is used to generate one viewport reference-area and one region reference-area.
This viewport is positioned with its end edge coincident with the end edge of the content-rectangle of the page-level reference-area generated using the parent fo:simple-page-master. In the direction perpendicular to the end edge, the size of the viewport is determined by the extent trait on the fo:region-end formatting object.
In the direction parallel to the end edge, the size of the viewport is determined by the precedence trait on the adjacent fo:region-before and the fo:region-after. If the value of the precedence trait is "false", then the region-end viewport extends up to the before (or, respectively, after) edge of the content-rectangle of the page-level reference-area. In this case, the area generated by the region-end acts like a float into areas generated by the region-before (respectively, the region-after). If the value of the precedence trait on the adjacent regions is "true", then these adjacent regions float into the area generated by the region-end and the extent of the region end is (effectively) reduced by the incursions of the adjacent regions with the value of the precedence trait equal to "true".
Constraints:
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 the description of fo:simple-page-master.
Contents:
EMPTY
Properties:
Common Usage:
The content of the fo:flow formatting object is a sequence of flow objects that forms one "unit of content", such as an article, a chapter, or a section. The result of formatting this "unit of content" is distributed across the pages generated by the fo:page-sequence which is the parent of the fo:flow.
Areas:
The fo:flow formatting object does not generate any areas. The fo:flow formatting object returns 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.
Constraints:
The (implicit) flow-map determines the assignment of the content of the fo:flow to a region.
Contents:
(%block;)+
Properties:
Common Usage:
The fo:static-content formatting object is used to group a "unit of content" that may be used on more than one page, such as the content of a header or footer. This "unit of content" is repeated, in its entirety, on every page to which it is assigned.
Areas:
The fo:staic-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:flow. The order of concatenation is the same order as the children are ordered under the fo:static-content.
Constraints:
The (implicit) flow-map determines the assignment of the content of the fo:static-content to a region.
Contents:
(%block;)+
Properties:
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 style sheet.
Input sample:
<doc>
<chapter><title>Chapter</title>
<p>Text</p>
<section><title>Section</title>
<p>Text</p>
</section>
<section><title>Section</title>
<p>Text</p>
</section>
</chapter>
<chapter><title>Chapter</title>
<p>Text</p>
<section><title>Section</title>
<p>Text</p>
</section>
<section><title>Section</title>
<p>Text</p>
</section>
</chapter>
</doc>
In this example the Chapter title appears at the top of the page (its "space-before" is discarded).
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
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.
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.
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.
The indent on the first line of the first paragraph in section one and the only paragraph in section two is 2pc; the indent on the first line of the second paragraph in section one is zero.
XSL Stylesheet:
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
version='1.0'>
<xsl:template match="chapter">
<fo:block break-before="page">
<xsl:apply-templates/>
</fo:block>
</xsl:template>
<xsl:template match="chapter/title">
<fo:block text-align="center" space-after="8pt"
space-before="16pt" space-after.precedence="3">
<xsl:apply-templates/>
</fo:block>
</xsl:template>
<xsl:template match="section/title">
<fo:block text-align="center" space-after="6pt"
space-before="12pt" space-before.precedence="0"
space-after.precedence="3">
<xsl:apply-templates/>
</fo:block>
</xsl:template>
<xsl:template match="p[1]" priority="1">
<fo:block text-indent="0pc" space-after="7pt"
space-before.minimum="6pt" space-before.optimum="8pt"
space-before.maximum="10pt">
<xsl:apply-templates/>
</fo:block>
</xsl:template>
<xsl:template match="p">
<fo:block text-indent="2pc" space-after="7pt"
space-before.minimum="6pt" space-before.optimum="8pt"
space-before.maximum="10pt">
<xsl:apply-templates/>
</fo:block>
</xsl:template>
</xsl:stylesheet>
Result Instance: elements and attributes in the fo: namespace
<fo:block break-before="page"> <fo:block text-align="center" space-after="8pt" space-before="16pt" space-after.precedence="3">Chapter </fo:block> <fo:block text-indent="0pc" space-after="7pt" space-before.minimum="6pt" space-before.optimum="8pt" space-before.maximum="10pt">Text </fo:block> <fo:block text-align="center" space-after="6pt" space-before="12pt" space-before.precedence="0" space-after.precedence="3">Section </fo:block> <fo:block text-indent="0pc" space-after="7pt" space-before.minimum="6pt" space-before.optimum="8pt" space-before.maximum="10pt">Text </fo:block> <fo:block text-align="center" space-after="6pt" space-before="12pt" space-before.precedence="0" space-after.precedence="3">Section </fo:block> <fo:block text-indent="0pc" space-after="7pt" space-before.minimum="6pt" space-before.optimum="8pt" space-before.maximum="10pt">Text </fo:block> </fo:block> <fo:block break-before="page"> <fo:block text-align="center" space-after="8pt" space-before="16pt" space-after.precedence="3">Chapter </fo:block> <fo:block text-indent="0pc" space-after="7pt" space-before.minimum="6pt" space-before.optimum="8pt" space-before.maximum="10pt">Text </fo:block> <fo:block text-align="center" space-after="6pt" space-before="12pt" space-before.precedence="0" space-after.precedence="3">Section </fo:block> <fo:block text-indent="0pc" space-after="7pt" space-before.minimum="6pt" space-before.optimum="8pt" space-before.maximum="10pt">Text </fo:block> <fo:block text-align="center" space-after="6pt" space-before="12pt" space-before.precedence="0" space-after.precedence="3">Section </fo:block> <fo:block text-indent="0pc" space-after="7pt" space-before.minimum="6pt" space-before.optimum="8pt" space-before.maximum="10pt">Text </fo:block> </fo:block>
Common Usage:
The fo:block formatting object is commonly used for formatting paragraphs, titles, headlines, figure and table captions, etc.
Areas:
Each fo:block formatting object returns a sequence of one or more areas, including at least one normal area. Each of the normal areas returned by an fo:block formatting object F is a block area and is generated by F.
Trait Derivation:
The nominal-glyph-height trait is set from the computed value of the "font-size" property. The half-leading trait is set to 1/2 the computed value of the "line-height" property minus the "font-size" property.
Constraints:
The children of each normal area returned by an fo:block formatting object must be properly stacked.
No area may have more than one normal child area returned by the same fo:block formatting object.
For each child of a normal area returned by an fo:block formatting object F, either
the area is a normal area returned by a child of F, or
the area is a line area that was generated by F
For each area generated by an fo:block formatting object F, either
the area is returned by F, or
the area is a line area that is a child of a normal area returned by F, or
the area is child of a line area generated by F, and has a non-null composed-by trait
The original area sequence of a line area ia a sequence of areas produced from the sequence of child areas by replacing each child area that has a non-null composed-from trait by the sequence of areas that is the value of the composed-from trait.
The original area sequences of the line areas generated by a fo:block formatting object F must correspond to the normal inline areas returned by children of F. More precisely, the original area sequence of a fo:block formatting object F is defined as follows. The original area sequence of F must be the same as the concatenation of the normal areas in the sequences returned by the children of F.
An area with a non-null composed-by trait can be generated in the following circumstances:
inserting hyphens at the end of a line
dropping spaces at the end of a line
substituting and reordering glyphs based on font information
Contents:
(#PCDATA|%inline;|%block;)*
In addition an optional fo:initial-property-set may be the first child of the fo:block.
Properties:
Common use:
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.
NOTE:The use of this flow object is not required for changing the inline-progression-direction only; in that case the Unicode bidi algorithm and the fo:bidi-override are sufficient.
Area type:
The fo:block-container flow object results in a block-area. If the block-area will not fit in the remaining space in the containing area, one (or more) additional areas may be generated by the formatter, consistent with the constraints given by the properties of the content of this flow object. The area is a reference-area.
Content distribution:
The size of 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 resulting from this flow object are placed.
The size in the block-progression-direction is determined by the content of this flow object.
Content:
(%block;)+
Properties:
Inline 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.
putting the first line of a paragraph into small-caps,
turning a normally inline formatting object, fo:external-graphic, into a block by "wrapping" with an fo:block formatting object,
formatting a running footer containing the word "Page" followed by a page number.
Input sample:
<doc> <p>This is the text of a paragraph that is going to be presented with the first line in small-caps.</p> </doc>
XSL Stylesheet:
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
version='1.0'>
<xsl:template match="p">
<fo:block>
<fo:initial-property-set font-variant="small-caps"/>
<xsl:apply-templates/>
</fo:block>
</xsl:template>
</xsl:stylesheet>
Result instance: elements and attributes in the fo: namespace
<fo:block> <fo:initial-property-set font-variant="small-caps"> </fo:initial-property-set>This is the text of a paragraph that is going to be presented with the first line in small-caps. </fo:block>
Input sample:
<doc>
<figure>
<photo image="TH0317A.jpg"/>
<caption>C'ieng Tamlung of C'ieng Mai</caption>
</figure>
</doc>
In this example the image (an fo:external-graphic) is placed as a centered block-level object. The caption is centered with 10mm indents.
XSL Stylesheet:
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
version='1.0'>
<xsl:template match="figure">
<fo:block>
<xsl:apply-templates/>
</fo:block>
</xsl:template>
<xsl:template match="photo">
<fo:block text-align="center">
<fo:external-graphic href="{@image}"/>
</fo:block>
</xsl:template>
<xsl:template match="caption">
<fo:block space-before="3pt" text-align="center"
start-indent="10mm" end-indent="10mm">
<xsl:apply-templates/>
</fo:block>
</xsl:template>
</xsl:stylesheet>
fo: element and attribute tree:
<fo:block>
<fo:block text-align="center">
<fo:external-graphic href="TH0317A.jpg"/>
</fo:block>
<fo:block space-before="3pt" text-align="center" start-indent="10mm"
end-indent="10mm">C'ieng Tamlung of C'ieng Mai</fo:block>
</fo:block>
Input sample:
<!DOCTYPE doc SYSTEM "pgref.dtd">
<doc>
<chapter id="x"><title>Chapter</title>
<p>Text</p>
</chapter>
<chapter><title>Chapter</title>
<p>For a description of X see <ref refid="x"/>.</p>
</chapter>
</doc>
In this example each page has a running footer containing the word "Page" followed by the page number. The "ref" element generates the word "see" followed by the page number of the page on which the referenced by the "refid" attribute was placed.
XSL Stylesheet:
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
version='1.0'>
<xsl:template match="doc">
<fo:root>
<fo:layout-master-set>
<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">
<fo:region-body
margin-top="0mm" margin-bottom="15mm"
margin-left="0mm" margin-right="0mm"/>
<fo:region-after extent="10mm"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-name="page">
<fo:static-content flow-name="xsl-region-after">
<fo:block>
<xsl:text>Page </xsl:text>
<fo:page-number/>
</fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
<xsl:apply-templates/>
</fo:flow>
</fo:page-sequence>
</fo:root>
</xsl:template>
<xsl:template match="chapter/title">
<fo:block id="{generate-id(.)}">
<xsl:number level="multiple" count="chapter" format="1. "/>
<xsl:apply-templates/>
</fo:block>
</xsl:template>
<xsl:template match="p">
<fo:block>
<xsl:apply-templates/>
</fo:block>
</xsl:template>
<xsl:template match="ref">
<xsl:text>page </xsl:text>
<fo:page-number-citation refid="{generate-id(id(@refid)/title)}"/>
</xsl:template>
</xsl:stylesheet>
Result Instance: elements and attributes in the fo: namespace
<fo:root>
<fo:layout-master-set>
<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">
<fo:region-body margin-top="0mm" margin-bottom="15mm"
margin-left="0mm" margin-right="0mm"/>
<fo:region-after extent="10mm"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-name="page">
<fo:static-content flow-name="xsl-region-after">
<fo:block>Page <fo:page-number/>
</fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
<fo:block id="N5">1. Chapter</fo:block>
<fo:block>Text</fo:block>
<fo:block id="N13">2. Chapter</fo:block>
<fo:block>For a description of X see page <fo:page-number-citation refid="N5"/>
</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>
Common use:
The fo:bidi-override formatting object is used when the Unicode-bidi algorithm fails. It forces a string of text to be written in a specific direction.
Area type:
The fo:bidi-override formatting object produces an inline-area.
Area size:
The size of the area is determined in the same manner as all other inline-areas.
Determination of trait values:
The "direction" property is combined with the "writing-mode" to determine the new writing-direction.
Content:
(#PCDATA|%inline;)*
Properties:
Common use:
The fo:character flow object represents a character that is mapped to a glyph for presentation. It is an atomic unit to the formatter.
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 semantic of an "auto" value for character properties, which is typically their initial value, are based on the Unicode codepoint. Overrides may be specified in an implementation-specific manner.
NOTE:In a stylesheet the explicit creation of an fo:character may be used to explicitly override the default mapping.
Area type:
The fo:character flow object results in a single inline area.
Content distribution:
The width and height of the area is determined by the font metrics for the glyph.
When formatting an fo:character with a "treat-as-wordspace" value of "yes", the User Agent may use a different method for determining the actual-inline-progression-dimension of the area.
Content:
EMPTY
Properties:
Common use:
The fo:initial-property-set specifies formatting properties for the first line of an fo:block.
NOTE:It is analogous to the CSS first-line pseudo-element.
In future verions of this recommendation a property controlling the number of lines, or the "depth" that these initial properties apply to may be added.
Area type:
The fo:initial-property-set object does not directly produce any area.
Determination of trait values:
The properties specified on the fo:initial-property-set are taken into account as if the inline formatting objects, or parts of them in the case of a line break, that were used in formatting the first line were enclosed by and fo:inline-sequence, as a direct child of the fo:block, with those properties specified.
Content:
EMPTY
Properties:
Issue (scaling-properties-for-graphics):
For scaling we want:
- scale factor for x and y
- individual for x and y
- max-width and height
- min-width and height
- height and width
Use cases:
- intrinsic size of graphic: just get it as is
- scale by a specified factor
- scale to a specified size
- put constraints on the scaling to be between
- Note fallback for graphics formats that do not have an intrinsic size.
- For the case of fixing the height of a graphic and caption and aligning the in x and y: use the fo:block-container.
CSS questions: is the graphic rescaled when its intrinsic height differs from the height property (and the height property is not "auto")
Common use:
The fo:external-graphic flow object is used for an inline graphic where the graphics data resides outside of the fo:element tree.
Area type:
The fo:external-graphic flow object results in a single inline-area.
Content distribution:
In the simple case, the "height" and "width" properties are used to set this object's size. If they are not specified, the "min-height" or "max-height" and "min-width" or "max-width" properties and the "scale-graphic" property (combined with any size specified by the content) are used to derive a size between the limits specified.
Content and its placement:
The fo:external-graphic flow object has no children.
Content:
EMPTY
Properties:
Common use:
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.
NOTE:A common format is SVG.
Area type:
The fo:instream-foreign-object flow object results in a single inline-area.
Content distribution:
In the simple case, the "height" and "width" properties are used to set this object's size. If they are not specified, the "min-height" or "max-height" and "min-width" or "max-width" properties and the "scale-graphic" property (combined with any size specified by the content) are used to derive a size between the limits specified.
Content:
The fo:instream-foreign-object flow object has children from a non-XSL namespace. The permitted structure of these children is that defined for that namespace.
The fo:instream-foreign-object flow object may have additional attributes in the non-XSL namespace. These are made available to the processor of the content of the flow object. Their semantics is defined by that namespace.
Properties:
Common Usage:
The fo:inline formatting object is commonly used for formatting a portion of text with a background or enclosing it in a border.
Areas:
Each fo:inline formatting object returns a sequence of one or more areas, including at least one normal area. Each of the normal areas returned by an fo:inline formatting object F is an inline area and is generated by F.
Constraints:
The children of each normal area returned by an fo:block formatting object must be properly stacked.
No area may have more than one normal child area returned by the same fo:inline formatting object.
Contents:
(#PCDATA|%inline;)*
Properties:
Common use:
The fo:inline-container flow object is used to generate an inline reference-area; typically containing text blocks with a different writing-mode.
NOTE:The use of this flow object is not required for bidirectional text; in this case the Unicode bidi algorithm and the fo:bidi-override are sufficient.
Area type:
The fo:inline-container flow object results in an inline-area. If the inline-area will not fit in the remaining space in the containing area, one (or more) additional areas may be generated by the formatter, consistent with the constraints given by the properties of the content of this flow object. The area is a reference-area.
Content distribution:
The size of the reference-area has to be fixed in the inline-progression-direction; it must be specified.
The size in the block-progression-direction is determined by the content of this flow object.
Content:
(%block;)+
Properties:
Common use:
The fo:leader formatting object is often used:
in TOCs to generate sequences of "." glyphs that separate titles from page numbers
to create entry fields in fill-in-the-blank forms
to create horizontal rules for use as separators
Area type:
The fo:leader formatting object results in a single inline-area.
Content distribution:
A leader is atomic and may not break/wrap across multiple lines.
The height of the content-rectangle is the "line-height", determined in the usual manner for inline-areas.
The width of the leader is determined as described in the "leader-length" property.
If the leader's minimum length is too long to place in the current line, 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 "overflow" property.
Content and its placement:
The fo:leader formatting object can have any inline formatting objects or PCDATA as its children, except that fo:leaders may not be nested. Its children are ignored unless the value of the "leader-pattern" property is "use-content".
NOTE:If the "leader-pattern" property is "use-content" and the fo:leader has no children, the leader shall be filled with blank space.
The inline-area generated by the fo:leader has a dimension in the inline-progression-direction which shall be at least the "leader-length.minimum" and at most the "leader-length.maximum".
For lines-areas that have been specified to be justified, the justified line-area must honor the "leader-alignment" property of any inline-areas generated by fo:leaders.
If the value of the "leader-pattern" property is "dots" or "use-content", the following constraints apply:
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 "leader-pattern" property, 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 "leader-pattern-width" and "leader-alignment" properties.
The "leader-pattern-width" property is ignored if its value is less than the width obtained by formatting the specified leader pattern.
Content:
(#PCDATA|%inline;)*
The content must not contain an fo:leader, or fo:inline-container, either as a direct child or as a descendant.
Properties:
NOTE: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.
NOTE:The alignment of the leader may be script specific and may require indicating what aligment 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 baseline.
NOTE:An fo:leader can be wrapped in an fo:block to create a rule for separating or decorating block-areas.
Common use:
The fo:page-number flow object is used to obtain an inline-area whose content is the page number for the page on which the inline-area is placed.
Area type:
The fo:page-number flow object results in a single inline-area.
The content of this inline-area is 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.
The page number string is obtained by converting the page number on which the inline-area is placed in accordance with the number to string conversion properties specified on the page master used for instantiating the page.
Content distribution:
Height and width are determined in the usual manner for inline-areas.
Content:
EMPTY
Properties:
Common use:
The fo:page-number-citation is used to reference the page-number for the page containing the first normally sequenced area returned by the cited formatting object.
NOTE:It may be used to provide the page numbers in the table of contents, cross-references, and index entries.
Area type:
The fo:page-number-citation flow object results in an inline-area in a manner analogous to that of the fo:page-number flow object.
Content distribution:
Height and width are determined in the usual manner for inline-areas.
Determination of trait values:
The "ref-id" property is used to locate the item being referenced. The page-number of the page containing the first area resulting from this item is then acquired as an unstyled text string and the character-level properties are applied to that string in the same manner as for fo:inline.
Content:
EMPTY
Properties:
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.
TBD
NOTE:This formatting object corresponds to the CSS anonymous box that encloses the table caption and the table.
Common use:
The fo:table-and-caption flow object is used for formatting a table together with its caption.
NOTE:A fo:table-and-caption may be placed inline by enclosing it in an fo:inline-container.
Area type:
The fo:table-and-caption flow object results in a block-area. If the block-area will not fit in the remaining space in the containing area, one (or more) additional areas may be generated by the formatter, consistent with the constraints given by the properties of the content, to accommodate the content.
Content distribution:
The width of the content-rectangle of the resulting block-area is the width of the content-rectangle of the containing reference-area less than the "start-indent" and "end-indent".
The height is determined by the height of the content.
Content and its placement:
The content of the table-and-caption flow object is one or two areas, acting as reference-areas; one for the table caption and one for the table itself. These are positioned relative to each other as specified by the "caption-side" property. They are placed relative to the content-rectangle as specified by the "text-align" property.
Content:
(table-caption?,table)
Properties:
Common use:
The fo:table flow object is used for formatting the tabular material of a table.
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.
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 of one or more rows in the table grid.
Area type:
The fo:table flow object results in a block-area. If the block-area will not fit in the remaining space in the containing area, one (or more) additional areas may be generated by the formatter, consistent with the constraints given by the properties of the rows, cells, and their content.
Determination of trait values:
The column-progression-direction and row-progression-direction are governed by the "writing-mode" property.
The width of the content-rectangle of the table is the sum of the widths of the columns in the table grid. The method used to determine these widths is specified by values of the "table-layout" and the "width" properties in the following manner:
The automatic table layout shall be used.
The automatic table layout shall be used.
The automatic table layout shall be used.
The fixed table layout shall be used.
The automatic table layout and fixed table layout is defined in 17.5.2 of the CSS2 specification.
The method for determining the height of the table is governed by the "height" property.
NOTE:The CSS2 specification explicitly does not specify what the behavior should be if there is a mismatch between an explicitly specified table height and the height of the content.
The method for deriving the border trait for a table is specified by the "border-collapse" property.
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. 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.
If the value of the "border-collapse" property is "collapse" the border is determined, for each segment, at the cell level.
NOTE:By specifying an appropriately high priority on the border specification for the fo:table one may ensure that this specification is the one used on all border segments.
The background color of a cell is determined in accordance with 17.5.1 of the CSS2 specification.
Content:
(table-column*,table-header?,table-footer?,table-body+)
Properties:
Common use:
The fo:table-column formatting object specifies characteristics applicable to table cells that have the same column and span. The most important property is the "column-width" property.
Type of Area:
This formatting object does not directly generate any area.
Content:
EMPTY
Properties:
Common use:
The fo:table-caption formatting object is used to contain block-level formatting objects containing the caption for the table.
Type of Area:
The fo:table-caption generates a reference-area.
Content Distribution and Size:
For the case when the value of the "caption-side" property is "before" or "after" the width of the reference-area is equal to the width of the content-rectangle of the reference-area that encloses it.
When the value is "start" or "end" the width of the reference-area is given by the "caption-width" property.
Content:
(%block;)+
Properties:
Common use:
The fo:table-header formatting object is used to contain the content of the table header.
Type of Area:
This formatting object does not directly create any area.
Content:
(table-row+|table-cell+)
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.
Properties:
Common use:
The fo:table-footer formatting object is used to contain the content of the table footer.
Type of Area:
This formatting object does not directly create any area.
Content:
(table-row+|table-cell+)
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.
Properties:
Common use:
The fo:table-body formatting object is used to contain the content of the table body.
Type of Area:
This formatting object does not directly create any area.
Content:
(table-row+|table-cell+)
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.
Properties:
Common use:
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.
Type of Area:
This formatting object does not directly create any area.
Content Distribution and Size:
The method for determining the height of the row in the grid is governed by the "row-height" property.
Content:
(table-cell+)
Properties:
Common use:
The fo:table-cell formatting object is used to group content to be placed in a table-cell.
Type of Area:
A table-cell occupies one or more grid units in the row-progression-direction and column-progression-direction and acts as a reference-area. 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:
If the value of the "border-collapse" property is "separate": half the value of the "border-separation" property; otherwise 0.
If the value of the "border-collapse" property is "separate": the thickness of the cell-border; otherwise half the thickness of the effective border.
The cell padding.
Content Distribution and Size:
The method for determining the height of the cell in the grid is governed by the "row-height" property.
Determination of Trait Values:
background: in accordance with the CSS2 inheritance rules specified in 17.5.1.
NOTE:A cell that is spanned may have a different background in each of the grid units it occupies.
border: the method for deriving the border for a cell is specified by the "border-collapse" property.
If the value of the "border-collapse" property 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 "border-separation" property. It is filled in accordance with the "background" property 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.
If the value of the "border-collapse" property 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 highest priority. It is an error if there are two such borders that have the same priority but are not identical. Each border segment is placed centered on the table grid boundary line.
padding: the value for the table-cell; either specified or inherited.
Content:
(%block;)+
Properties:
There are four formatting objects used to construct lists: fo:list-block, fo:list-item, fo:list-item-label, and fo:list-item-body.
Tree representation of the formatting Objects for Lists.
The fo:list-block has the role of containing the complete list and to specify values used for the list geometry in the inline-progression-direction (see details below).
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.
The fo:list-item has the role of containing each item in a list.
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 ding-bat character, or a term.
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.
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.
The specification of the list geometry in the inline-progression-direction is achieved by:
Specifying appropiate 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.
Specifying end-indent="label-end()" on the fo:list-item-label.
Specifying start-indent="body-start()" on the fo:list-item-body.
NOTE:These list specific functions are defined below.
The start-indent of the list item label and end-indent of the list item body, if desired, are typically specified as a length.
The list-items are contained in an "ol" element. The items are contained in "item" elements and contain text (as opposed to paragraphs).
The style is to number the items alphabetically with a dot at the end of the number.
XSL Stylesheet:
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
version='1.0'>
<xsl:template match="ol">
<fo:list-block provisional-distance-between-starts="15mm"
provisional-label-separation="5mm">
<xsl:apply-templates/>
</fo:list-block>
</xsl:template>
<xsl:template match="ol/item">
<fo:list-item>
<fo:list-item-label start-indent="5mm" end-indent="label-end()">
<fo:block>
<xsl:number format="a."/>
</fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>
<xsl:apply-templates/>
</fo:block>
</fo:list-item-body>
</fo:list-item>
</xsl:template>
</xsl:stylesheet>
Input sample:
<ol> <item>List item 1.</item> <item>List item 2.</item> <item>List item 3.</item> </ol>
Result Instance: elements and attributes in the fo: namespace
<fo:list-block provisional-distance-between-starts="15mm"
provisional-label-separation="5mm">
<fo:list-item>
<fo:list-item-label start-indent="5mm" end-indent="label-end()">
<fo:block>a.
</fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>List item 1.
</fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label start-indent="5mm" end-indent="label-end()">
<fo:block>b.
</fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>List item 2.
</fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label start-indent="5mm" end-indent="label-end()">
<fo:block>c.
</fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>List item 3.
</fo:block>
</fo:list-item-body>
</fo:list-item>
</fo:list-block>
In this example the stylesheet processes HTML-style "dl" lists, which contain unwrapped pairs of "dt" and "dd" elements, transforming them into fo:list-blocks.
Balanced pairs of "dt"/"dd"s are converted into fo:list-items. For unbalanced "dt"/"dd"s, the stylesheet makes the following assumptions:
Multiple "dt"s are grouped together into a single fo:list-item-label in a single list-item.
Multiple DDs are:
Output as individual FO list-items with an empty list-item-label if the stylesheet variable $allow-naked-dd is true.
Are grouped together into a single FO list-item-body if $allow-naked-dd is false.
In other words, given a structure like this:
<doc> <dl> <dt>term</dt> <dd>definition</dd> <dt>term</dt> <dt>term</dt> <dd>definition</dd> <dt>term</dt> <dd>definition</dd> <dd>definition</dd> </dl> </doc>
If $allow-naked-dd is true, the result instance: elements and attributes in the fo: namespace is:
<fo:list-block provisional-distance-between-starts="35mm"
provisional-label-separation="5mm">
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block>term
</fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>definition
</fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block>term
</fo:block>
<fo:block>term
</fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>definition
</fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block>term
</fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>definition
</fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>definition
</fo:block>
</fo:list-item-body>
</fo:list-item>
</fo:list-block>
If $allow-naked-dd is false, the result instance: elements and attributes in the fo: namespace is:
<fo:list-block provisional-distance-between-starts="35mm"
provisional-label-separation="5mm">
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block>term
</fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>definition
</fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block>term
</fo:block>
<fo:block>term
</fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>definition
</fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block>term
</fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>definition
</fo:block>
<fo:block>definition
</fo:block>
</fo:list-item-body>
</fo:list-item>
</fo:list-block>
XSL Stylesheet:
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
version='1.0'>
<xsl:include href="dtdd.xsl"/>
<xsl:template match="doc">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="dl">
<xsl:call-template name="process.dl"/>
</xsl:template>
<xsl:template match="dt|dd">
<fo:block>
<xsl:apply-templates/>
</fo:block>
</xsl:template>
</xsl:stylesheet>
Included stylesheet "dtdd.xsl"
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
version='1.0'>
<xsl:variable name="allow-naked-dd" select="true()"/>
<xsl:template name="process.dl">
<fo:list-block provisional-distance-between-starts="35mm"
provisional-label-separation="5mm">
<xsl:choose>
<xsl:when test="$allow-naked-dd">
<xsl:call-template name="process.dl.content.with.naked.dd"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="process.dl.content"/>
</xsl:otherwise>
</xsl:choose>
</fo:list-block>
</xsl:template>
<xsl:template name="process.dl.content.with.naked.dd">
<xsl:param name="dts" select="./force-list-to-be-empty"/>
<xsl:param name="nodes" select="*"/>
<xsl:choose>
<xsl:when test="count($nodes)=0">
<!-- Out of nodes, output any pending DTs -->
<xsl:if test="count($dts)>0">
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<xsl:apply-templates select="$dts"/>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()"/>
</fo:list-item>
</xsl:if>
</xsl:when>
<xsl:when test="name($nodes[1])='dd'">
<!-- We found a DD, output the DTs and the DD -->
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<xsl:apply-templates select="$dts"/>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<xsl:apply-templates select="$nodes[1]"/>
</fo:list-item-body>
</fo:list-item>
<xsl:call-template name="process.dl.content.with.naked.dd">
<xsl:with-param name="nodes" select="$nodes[position()>1]"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="name($nodes[1])='dt'">
<!-- We found a DT, add it to the list of DTs and loop -->
<xsl:call-template name="process.dl.content.with.naked.dd">
<xsl:with-param name="dts" select="$dts|$nodes[1]"/>
<xsl:with-param name="nodes" select="$nodes[position()>1]"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<!-- This shouldn't happen -->
<xsl:message>
<xsl:text>DT/DD list contained something bogus (</xsl:text>
<xsl:value-of select="name($nodes[1])"/>
<xsl:text>).</xsl:text>
</xsl:message>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="process.dl.content">
<xsl:param name="dts" select="./force-list-to-be-empty"/>
<xsl:param name="dds" select="./force-list-to-be-empty"/>
<xsl:param name="output-on"></xsl:param>
<xsl:param name="nodes" select="*"/>
<!-- The algorithm here is to build up a list of DTs and DDs, -->
<!-- outputing them only on the transition from DD back to DT -->
<xsl:choose>
<xsl:when test="count($nodes)=0">
<!-- Out of nodes, output any pending elements -->
<xsl:if test="count($dts)>0 or count($dds)>0">
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<xsl:apply-templates select="$dts"/>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<xsl:apply-templates select="$dds"/>
</fo:list-item-body>
</fo:list-item>
</xsl:if>
</xsl:when>
<xsl:when test="name($nodes[1])=$output-on">
<!-- We're making the transition from DD back to DT -->
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<xsl:apply-templates select="$dts"/>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<xsl:apply-templates select="$dds"/>
</fo:list-item-body>
</fo:list-item>
<!-- Reprocess this node (and the rest of the node list) -->
<!-- resetting the output-on state to nil -->
<xsl:call-template name="process.dl.content">
<xsl:with-param name="nodes" select="$nodes"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="name($nodes[1])='dt'">
<!-- We found a DT, add it to the list and loop -->
<xsl:call-template name="process.dl.content">
<xsl:with-param name="dts" select="$dts|$nodes[1]"/>
<xsl:with-param name="dds" select="$dds"/>
<xsl:with-param name="nodes" select="$nodes[position()>1]"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="name($nodes[1])='dd'">
<!-- We found a DD, add it to the list and loop, noting that -->
<!-- the next time we cross back to DT's, we need to output the -->
<!-- current DT/DDs. -->
<xsl:call-template name="process.dl.content">
<xsl:with-param name="dts" select="$dts"/>
<xsl:with-param name="dds" select="$dds|$nodes[1]"/>
<xsl:with-param name="output-on">dt</xsl:with-param>
<xsl:with-param name="nodes" select="$nodes[position()>1]"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<!-- This shouldn't happen -->
<xsl:message>
<xsl:text>DT/DD list contained something bogus (</xsl:text>
<xsl:value-of select="name($nodes[1])"/>
<xsl:text>).</xsl:text>
</xsl:message>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
The "dtdd.xsl" stylesheet may be customized in the following ways:
Set the value of $allow-naked-dd to control the processing of unbalanced "dd"s.
Change "dt" to the name of the element which is a term in the list.
Change "dd" to the name of the element which is a definition in the list.
In the, perhaps unlikely, event that the documents may contain an element named "force-list-to-be-empty", that element name should be changed to a name that is not used in the documents.
In the stylesheet using the "dtdd.xsl" stylesheet change the "dl" to the name of the element which is the wrapper for the list.
Common use:
The fo:list-block flow object is used to format a list item or a list.
Type of Area:
The fo:list-block flow object results in a block-area. If the block-area will not fit in the remaining space in the containing area, one (or more) additional areas may be generated by the formatter, consistent with the constraints given by the content of the list-block.
Content and its Placement:
The list-block must have one or more fo:list-item formatting objects as children.
The areas produced by these are placed one after the other in the block-progression-direction.
Content:
(list-item+)
Properties:
Common use:
The fo:list-item formatting object contains the label and the body of an item in a list.
Type of Area:
The fo:list-item flow object results in a block-area. If the block-area will not fit in the remaining space in the containing area, one (or more) additional areas may be generated by the formatter, consistent with the constraints given by the content of the list-item.
Content Distribution and Size:
The width of the content-rectangle of the block-area is the width of the reference-area into which it is placed minus the start-indent and end-indent.
The height is determined by the content of the fo:list-item.
Content and its Placement:
The placement of the areas produced by formatting the fo:list-item-label and fo:list-item-body objects are positioned with respect to each other in the following manner:
In the block-progression-direction these areas are positioned according to the "relative-align" property.
In the inline-progression-direction these areas are positioned according to the start-indent and end-indent properties of the content of the fo:list-item-label and fo:list-item-body formatting objects. It is an error if the areas overlap.
NOTE: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.
Content:
(list-item-label,list-item-body)
Properties:
Common use:
The fo:list-item-body formatting object contains the content of the body of a list-item.
Type of Area:
The fo:list-item-body formatting object does not directly create any area.
Content:
(%block;)+
Properties:
Common use:
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.
Type of Area:
The fo:list-item-label formatting object does not directly create any area.
Content:
(%block;)+
Properties:
The following classes of "dynamic" effects are covered by the formatting objects included in this section:
One-directional single-target links.
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.
The ability to switch between different property values, such as color or font-weight, depending on DOM state, such as "mouse-over".
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.
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.
Input sample:
<doc>
<chapter><title>Chapter</title>
<p>Text</p>
<section><title>Section</title>
<p>Text</p>
</section>
<section><title>Section</title>
<p>Text</p>
</section>
</chapter>
<chapter><title>Chapter</title>
<p>Text</p>
<section><title>Section</title>
<p>Text</p>
</section>
<section><title>Section</title>
<p>Text</p>
</section>
</chapter>
</doc>
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 preceeded 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.
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.
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 fo:simple-link referring to that id.
XSL Stylesheet:
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
version='1.0'>
<xsl:template match="doc">
<!-- create the table of contents -->
<xsl:apply-templates select="chapter/title" mode="toc"/>
<!-- do the document -->
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="chapter/title" mode="toc">
<fo:multi-switch>
<fo:multi-case case-name="collapsed" case-title="collapsed"
starting-state="show">
<fo:block>
<fo:multi-toggle switch-to="expanded">
<fo:external-graphic href="plus-icon.gif"/>
</fo:multi-toggle>
<fo:simple-link internal-destination="{generate-id(.)}">
<xsl:number level="multiple" count="chapter" format="1. "/>
<xsl:apply-templates mode="toc"/>
</fo:simple-link>
</fo:block>
</fo:multi-case>
<fo:multi-case case-name="expanded" case-title="expanded"
starting-state="hide">
<fo:block>
<fo:multi-toggle switch-to="collapsed">
<fo:external-graphic href="minus-icon.gif"/>
</fo:multi-toggle>
<fo:simple-link internal-destination="{generate-id(.)}">
<xsl:number level="multiple" count="chapter" format="1. "/>
<xsl:apply-templates mode="toc"/>
</fo:simple-link>
</fo:block>
<xsl:apply-templates select="../section/title" mode="toc"/>
</fo:multi-case>
</fo:multi-switch>
</xsl:template>
<xsl:template match="section/title" mode="toc">
<fo:block start-indent="10mm">
<fo:simple-link internal-destination="{generate-id(.)}">
<xsl:number level="multiple" count="chapter|section" format="1.1 "/>
<xsl:apply-templates/>
</fo:simple-link>
</fo:block>
</xsl:template>
<xsl:template match="chapter/title">
<fo:block id="{generate-id(.)}">
<xsl:number level="multiple" count="chapter" format="1. "/>
<xsl:apply-templates/>
</fo:block>
</xsl:template>
<xsl:template match="section/title">
<fo:block id="{generate-id(.)}">
<xsl:number level="multiple" count="chapter|section" format="1.1 "/>
<xsl:apply-templates/>
</fo:block>
</xsl:template>
<xsl:template match="p">
<fo:block>
<xsl:apply-templates/>
</fo:block>
</xsl:template>
</xsl:stylesheet>
Result Instance: elements and attributes in the fo: namespace
<fo:multi-switch>
<fo:multi-case case-name="collapsed" case-title="collapsed" starting-state="show">
<fo:block>
<fo:multi-toggle switch-to="expanded">
<fo:external-graphic href="plus-icon.gif">
</fo:external-graphic>
</fo:multi-toggle>
<fo:simple-link internal-destination="N4">1. Chapter
</fo:simple-link>
</fo:block>
</fo:multi-case>
<fo:multi-case case-name="expanded" case-title="expanded" starting-state="hide">
<fo:block>
<fo:multi-toggle switch-to="collapsed">
<fo:external-graphic href="minus-icon.gif">
</fo:external-graphic>
</fo:multi-toggle>
<fo:simple-link internal-destination="N4">1. Chapter
</fo:simple-link>
</fo:block>
<fo:block start-indent="10mm">
<fo:simple-link internal-destination="N11">1.1 Section
</fo:simple-link>
</fo:block>
<fo:block start-indent="10mm">
<fo:simple-link internal-destination="N19">1.2 Section
</fo:simple-link>
</fo:block>
</fo:multi-case>
</fo:multi-switch>
<fo:multi-switch>
<fo:multi-case case-name="collapsed" case-title="collapsed" starting-state="show">
<fo:block>
<fo:multi-toggle switch-to="expanded">
<fo:external-graphic href="plus-icon.gif">
</fo:external-graphic>
</fo:multi-toggle>
<fo:simple-link internal-destination="N28">2. Chapter
</fo:simple-link>
</fo:block>
</fo:multi-case>
<fo:multi-case case-name="expanded" case-title="expanded" starting-state="hide">
<fo:block>
<fo:multi-toggle switch-to="collapsed">
<fo:external-graphic href="minus-icon.gif">
</fo:external-graphic>
</fo:multi-toggle>
<fo:simple-link internal-destination="N28">2. Chapter
</fo:simple-link>
</fo:block>
<fo:block start-indent="10mm">
<fo:simple-link internal-destination="N35">2.1 Section
</fo:simple-link>
</fo:block>
<fo:block start-indent="10mm">
<fo:simple-link internal-destination="N43">2.2 Section
</fo:simple-link>
</fo:block>
</fo:multi-case>
</fo:multi-switch>
<fo:block id="N4">1. Chapter
</fo:block>
<fo:block>Text
</fo:block>
<fo:block id="N11">1.1 Section
</fo:block>
<fo:block>Text
</fo:block>
<fo:block id="N19">1.2 Section
</fo:block>
<fo:block>Text
</fo:block>
<fo:block id="N28">2. Chapter
</fo:block>
<fo:block>Text
</fo:block>
<fo:block id="N35">2.1 Section
</fo:block>
<fo:block>Text
</fo:block>
<fo:block id="N43">2.2 Section
</fo:block>
<fo:block>Text
</fo:block>
Common use:
The fo:simple-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.
Type of Area:
The fo:simple-link flow object results in an inline-area. If the inline-area will not fit in the remaining space in the containing line-area, one (or more) additional areas may be generated by the formatter, consistent with the constraints given by the properties of the content, to accommodate the content.
NOTE:An fo:simple-link may be displayed by enclosing it in an fo:block.
Content Distribution and Size:
The width is determined by the content. The height is determined by the height of the content.
The content is formatted in the general manner of inlines.
Content:
(#PCDATA|%inline;|%block;)*
Properties:
Common use:
The fo:multi-switch is used to switch between two or more sub-trees of formatting objects.
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.
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.
NOTE: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.
The fo:multi-switch shall initially display the first fo:multi-case child that has the property "starting-state" assigned to "show".
Type of Area:
The fo:multi-switch does not directly create any areas, but acts as an transparent container, and is (conceptually) replaced by the currently visible flow objects.
Content:
(multi-case+)
Properties:
Common use:
The fo:multi-case is used to embed flow objects, that the parent fo:multi-switch can choose to either show or hide.
Type of Area:
The fo:multi-case does not directly create any areas, but acts as a transparent container, and is (conceptually) replaced by the flow objects it contains.
Content:
(#PCDATA|%inline;|%block;)*
The fo:multi-case may contain any formatting objects that are permitted as a replacement of the fo:multi-switch formatting object. In particular, it can contain fo:multi-toggle objects (at any depth), which controls the fo:multi-case switching.
Properties:
Common use:
The fo:multi-toggle is typically used to create an area that when "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.
Type of Area:
The fo:multi-toggle results in the sequence of areas obtained by formatting the content of the fo:multi-toggle formatting object.
Content:
(#PCDATA|%inline;|%block;)*
Properties:
Common use:
The fo:multi-properties is used to switch between two or more property sets that are associated with a given portion of content. The direct children of an fo:multi-properties formatting object is an ordered set of fo:multi-property-set formatting objects followed by any character, inline, and block-level formatting objects. The specified properties of all fo:multi-property-set formatting objects for states that apply are merged. In this merger, properties specified in later fo:multi-property-set objects replace any values set in earlier fo:multi-property-set objects. This assembled set of property specifications are added to the inheritable properties for all the child formatting objects of the fo:multi-properties formatting object that are not of the class fo:multi-property-set. This has the same effect as if an fo:wrapper formatting object with the assembled set of property specifications had enclosed them. If no states apply, there is no change to the inheritable properties. The states on the fo:multi-property-set are the states (and events) that are identified by the DOM.
NOTE: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.
Type of Area:
The fo:multi-properties does not directly result in any areas. Areas may be generated by formatting the content of the fo:multi-properties formatting object.
Content:
(multi-property-set+,wrapper)
The properties that should take a merged value shall be specified with a value of "from-parent()". 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.
Properties:
Common use:
The fo:multi-property-set 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 parent of this fo:multi-property-set that are not of the fo:multi-property-set class.
Type of Area:
The fo:multi-property-set does not generate any area, but simply holds a set of properties.
Content:
EMPTY
Properties:
Issue (out-of-line):
This section is incomplete and may be inconsistent with other sections of this draft.
Conditional regions specify region-masters that are used to generate region reference-areas. These region reference-areas are called conditional reference-areas. Conditional reference-areas are generated only when one or more areas that would be descendant from these reference-areas are present on the page from which the conditional reference-area is descendant. The descendants of a conditional reference-area are out-of-line areas that are returned by formatting objects, such as footnotes and floats, which have children that generate areas that are not placed in the normal flow of areas.
Conditional regions are subdivisions of a region. They specify how space can be borrowed from that region either at the top or bottom of that region. The region from which the conditional region borrows space is called the containing region. When a region-master that contains conditional regions is used to generate a reference-area, some of the region reference-areas that correspond to the conditional regions may be generated as well.
Whether a conditional reference-area is generated depends on the presence of out-of-line areas that should be descendent from that conditional reference-area. If there are out-of-line areas, such as areas generated by an fo:footnote or fo:float, then the conditional reference-areas may be generated. Whether or not the conditional reference-areas are actually generated depends, additionally, on whether there is sufficient space left in the reference-area from which the space is being borrowed and whether constraints on the relationship between the placement of the out-of-line areas and the normal areas generated by the same formatting object are met. For example, a constraint on footnotes requires that the footnote begin on the same page as the reference to the footnote. In addition, constraints on other portions of the content on the page may produce an over-constrained situation; for example, if there is a long, unbreakable paragraph that contains the footnote reference and just fits on a page.
When one or more conditional reference-areas are generated, the parent reference-area must be subdivided. This subdivision gives meaning to the phrase, "a conditional region borrows space from the containing region". The subdivision preserves the original reference-area generated using the region-master. This original area is the parent area of the subdivision areas. Subdivision generates two or more reference-areas that are children of the original reference-area. All but one of these reference-areas are conditional reference-areas. These conditional reference-areas are aligned with the before-edge or after-edge, respectively of the content-rectangle of the parent reference-area.
The remaining reference-area corresponds to the remaining space after the borrowing done by the conditional regions. The traits of the remaining reference-area are set as they would be if the reference-area were generated by a region with no specified properties that was the child of the containing region. This insures that there is a transparent background and no margin, border, or padding; and that inherited properties are set as they would be when the region-master for the containing region is used to generate a reference-area. The block-progression-dimension (this is "height" when the writing-mode is "lr-tb") of the remaining reference-area is set equal to the block-progression-dimension of the parent reference-area minus the sum of the sizes in the block-progression-direction of the allocation-rectangles of the conditional reference-areas. The remaining reference-area is positioned to immediately follow the after edge of the allocation-rectangle of the last of the conditional reference-areas that are before the remaining reference-area. This positions the after-edge of the remaining reference-area to coincide with the before-edge of the allocation-rectangle of the first of the conditional reference-areas that are after the remaining reference-area. The areas that would have been children of the parent reference-area are made children of the remaining reference-area. In addition to the constraints normally determined by the original region, the inline-progression-dimension (this is "width" when the writing-mode is "lr-tb") of that region is constrained to match inline-progression-dimension of the remaining reference-area.
Issue (out-of-line-intro-space):
Should space-before and space-after be taken into account for the space consumed by the conditional regions. The allocation-rectangle size in the block-progression-direction does not include these.
There may be limits on how much space conditional regions can borrow from the containing region.
The association of out-of-line content (areas) with particular conditional regions (areas) is specified in the descriptions of the formatting objects that initially return the out-of-line content (areas).
The region-body region has an implicit conditional float region at the before-edge of the region and an implicit conditional footnote region at the after-edge of the region.
When an fo:footnote formatting object appears in a flow, it returns at least two kinds of areas. One kind of area is a normal inline-area to accommodate the footnote citation. This inline-area is generated in sequence with the areas generated by the flow objects preceding and following the fo:footnote formatting object. It is, therefore, assigned to the reference-area generated using the region-master associated with the flow in which the fo:footnote occurs.
The second kind of area that is returned by the fo:footnote formatting object is an out-of-line area. It becomes a descendant of the reference-area generated by the implicit conditional footnote region associated with the region to which the flow in which the fo:footnote occurs is assigned.
The conditional reference-area which has as its descendant the first (and usually only) out-of-line area returned by the fo:footnote is constrained to be a sibling of the reference-area which has as its descendant the first of normal areas returned by the fo:footnote. That is, the footnote must begin in the same instance of the containing region in which the footnote citation occurs.
NOTE:The actual areas generated by the descendants of the fo:footnote formatting object are determined by the formatting objects that comprise the descendant subtree. For example, if one wanted to format the footnote with a label and an indented body, then one could use the fo:list-block formatting object to format the content of the footnote.
When an fo:float formatting object appears in a flow, it returns out-of-line areas. These areas become descendants of reference-areas generated by the implicit conditional float region associated with the region to which the flow in which the fo:float occurs is assigned.
Issue (out-of-sequence-intro-error):
Should it be an error if an fo:float occurs in a flow that is not assigned to a region that has an implicit conditional "float" region. If it is an error is there a reasonable fallback, say put the float inline at the point of occurrence. This issue also applies to footnotes. Note that this would consistent with the fallback listed in the conformance summary since footnotes and floats are not in the "basic" formatting object set.
The constraint on the areas returned by an fo:float is that they may only be descendant from conditional reference-areas that are (a) descendant from areas generated using the region-masters for the region to which the flow that has the fo:float as a descendant is assigned, and (b) are descendent from the same page as the page in which normal areas returned by the fo:float would be descendants, or descendant from a page following that page in the sequence of pages that are children of the area tree root.
NOTE:Future versions of this specification will describe the above semantics as special cases of a more general mechanism that allows out-of-line areas to be assigned to conditional regions and the expression of constraints between the occurrences of normal areas and out-of-line areas.
TBD
Common Usage:
The fo:float formatting object holds a sequence formatting objects that is to be presented in a conditional-area at the top of an instance of a region with the same name as the region into which the fo:float flow object is distributed. The content of the fo:float flow object is not placed where the flow object is distributed, but is instead placed, out-of-line, in the next instance of the region with the same name for which there is room for the content of the fo:float. Such content might be a figure, a table or other chunk of content that is to be kept together and need not disrupt the flow of the content around it.
NOTE:Issue: Floating to the top of the same page should not be prohibited for systems that can support it.
Areas:
The fo:float flow object generates a block-area that is placed in a conditional-area anchored on the before edge of the region into which the fo:float flow object is distributed. The placement of the block-area generated by the fo:float into the conditional regions is called, "out-of-line" placement.
NOTE:Issue: Does it generate a block-area?!
Trait Derivation:
The coordinate system for the conditional-area for floats is set to the same orientation as the coordinate system of the region that contains the conditional-area. The writing-mode for the conditional-rererence-area is similarly copied from the region which contains it. Currently, there is no way to specify any of the common-border-padding-and-background-properties so the conditional region has no padding, borders or background.
Constraints:
The fo:floats which are distributed into a given region all generate a float block-area in a conditional-area for floats in the region into which they are distributed or in some subsequent instance of a region with the same name. That is, the content of the fo:float flow object is not distributed where the fo:float is distributed, but is instead formatted into a block-area that is placed, out-of-line, in the same or a subsequent region of the same name as the one in which the fo:float flow object was distributed.
The size of the conditional-area for floats, in the block-progression-direction, shall not exceed the computed value of the "max-height" property on the fo:float flow object.
The content of each fo:float is distributed into a single block-area whose height and width is determined by the common-margin-properties-block and the common-border-padding-and-background-properties. The conditional-area for floats is the reference-area into which this block-area is placed. The normal rules for space resolution apply to these blocks. The block-areas for floats are placed in conditional-areas for floats in the order in which the fo:float flow objects were distributed in the content distribution of the flow in which they occur. If a the block-area for a given float will not fit into the current conditional-area for floats, then it will be distributed into a conditional area for floats in a subsequent region of the same name as the current region. Instances of page-masters with a region of the same name will continue to be generated as long as there are float block-areas to be placed.
NOTE:Issue: What is to happen if there is a float that can never fit within the "max-height" of the conditional-area for floats. Should that float be split? Should it be ignored?
Contents:
(%block;)+
Properties:
Common Usage:
The fo:footnote formatting object represents both the place of occurrence of the footnote reference (or citation) and the content of the footnote itself. The footnote citation occurs where the fo:footnote flow object occurs; that is, the footnote citation is formatted inline. The footnote itself is formatted out of line; it is floated to the bottom of the page on which the footnote citation occurs.
The content of the fo:footnote is structured into two pieces. There is an fo:footnote-citation flow object which is an inline flow object that is used to specify the properties to be used in formatting the footnote citation. The remaining content of the fo:footnote flow object is the content of the footnote itself. If the footnote itself is to have a label and a body, then this content should be structured using the fo:list-block flow object containing an fo:list-label and an fo:list-body.
NOTE:Issue: The last sentence should be moved to a note and also stress that the use of list formatting objects is only when such a layout is desired.
Areas:
The fo:footnote formatting object generates two areas. The citation generates at least one inline-area into which the content of the fo:footnote-citation is distributed. This distribution into one or more inline-areas shall be consistent with the constraints determined by the properties applicable to the fo:footnote-citation flow object.
The fo:footnote flow object generates a block-area that is placed in a conditional-area anchored on the after edge of the region into which the fo:footnote-citation is distributed. The placement of the block-area generated by the fo:footnote into the conditional regions is called, "out-of-line" placement.
NOTE:Issue: Does it generate a block-area?!
Trait Derivation:
The coordinate system for the conditional-area for footnotes is set to the same orientation as the coordinate system of the region that contains the conditional-area. The writing-mode for the conditional-reference-area is similarly copied from the region which contains it. Currently, there is no way to specify any of the common-border-padding-and-background-properties so the conditional region has no padding, borders or background.
NOTE:Issue: Should there be a way to establish borders and/or padding and backgrounds for the conditional footnote areas?
Constraints:
The content of the fo:footnote-citation is distributed as specified in the description of the fo:footnote-citation flow object.
The fo:footnotes which have a citation distributed into a given region all generate a footnote block-area in the conditional-area for footnotes for the region into which they are distributed. One condition on the distribution of the footnote-citation inline-areas into a region is that footnote conditional-area for that region is large enough to hold the footnote block-areas for all the footnote-citations distributed to that region. In addition, the size of that conditional-area in the block-progression-direction shall not exceed the computed value of the "max-height" property on the fo:footnote flow object.
The content of each fo:footnote, excluding the fo:footnote-citation, is distributed into a single block-area whose height and width is determined by the common-margin-properties-block and the common-border-padding-and-background-properties. The conditional-area for footnotes is the reference-area into which this block-area is placed. The normal rules for space resolution apply to these blocks which are placed in the conditional-area for footnotes in the order in which the fo:footnote flow objects occurred in the content distributed into the region to which the footnote is attached.
Contents:
(%block;)+
Properties:
The following example shows the use of the fo:wrapper formatting object that has no semantics but acts as a "carrier" for inherited properties.
Input sample:
<doc> <p>This is an <emph>important word</emph> in this sentence that also refers to a <code>variable</code>.</p> </doc>
The "emph" elements are to be presented using a bold font and the "code" elements are using a Courier font.
XSL Stylesheet:
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
version='1.0'>
<xsl:template match="p">
<fo:block>
<xsl:apply-templates/>
</fo:block>
</xsl:template>
<xsl:template match="emph">
<fo:wrapper font-weight="bold">
<xsl:apply-templates/>
</fo:wrapper>
</xsl:template>
<xsl:template match="code">
<fo:wrapper font-family="Courier">
<xsl:apply-templates/>
</fo:wrapper>
</xsl:template>
</xsl:stylesheet>
fo: element and attribute tree:
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format">This is an <fo:wrapper font-weight="bold">important word</fo:wrapper> in this sentence that also refers to a <fo:wrapper font-family="Courier">variable</fo:wrapper>. </fo:block>
Common use:
The fo:wrapper formatting object is used to specify inherited properties for a group of formatting objects.
Area type:
The fo:wrapper formatting object does not directly generate any area. However, each of its children is individually formatted to produce a series of areas.
Determination of trait values:
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.
Content:
(#PCDATA|%inline;|%block;)*
Properties:
The following sections describe the properties of the XSL formatting objects.
The first eight sets of property definitions have been arranged into groups based on similar functionality and the fact that they apply to many formatting objects. In the formatting-object descriptions the group name is referred to rather than referring to the individual properties.
Common Absolute Position Properties
This set of properties controls the position and size of formatted areas with absolute or relative positioning (areas displaced from the default positioning in the text block).
Common Aural Properties
This group of properties controls the aural rendition of the content of a formatting object. They appear on all formatting objects that contain content and other formatting objects that group other formatting objects and where that grouping is necessary for the understanding of the aural rendition. An example of the latter is fo:table-and-caption.
Common Border, Padding, and Background Properties
This set of properties controls the backgrounds and borders on the block-areas and inline-areas. This property group appears on all formatting objects that produce visible renderings.
Common Font Properties
This set of properties controls the font selection on all formatting objects that can contain text. Appears on fo:block, fo:first-line-marker, and on inline formatting objects that contain or generate text.
Common Hyphenation Properties
Low-level control of line-breaking, including hyphenation and language selection. Appears on fo:block and fo:title.
Common Keeps and Breaks Properties
Controls page/column breaks before/after block-level formatting objects. Appears on most block-level formatting objects.
Common Margin Properties-Block
These properties set the spacing and indents surrounding block-level formatting objects.
Common Margin Properties-Inline
These properties set the spacing surrounding inline formatting objects.
The remaining properties are used on a small number of formatting objects. These are arranged into clusters of similar functionality to organize the property descriptions. In the formatting object description the individual properties are referenced.
Pagination Properties
These properties govern the sequencing, layout, and instantiation of pages, including: the page size and orientation, sizes of regions on the page-master, the identification and selection of page-masters, division of the body region into columns, and the assignment of content flows to layout regions.
Table Properties
Properties governing the layout and presentation of tables.
Character Properties
Properties governing the presentation of text-characters.
Leader Properties
Properties governing the construction of leaders and horizontal rules.
Page-related Properties
These properties augment the common-keeps-and-breaks-properties group by adding controls for widows, orphans, and page/column/line keeps.
Float-related properties
Properties governing the placement of floats and controlling the wrapping (runaround) of text that may be adjacent to the float.
Properties for Number-to-String Conversions
Properties used in the construction of page-numbers and other formatter-based numbering.
Properties for Links
Properties governing the presentation and actions associated with links.
Miscellaneous Properties
These properties did not reasonably fit into any of the other categories.
This section describes how to interpret property descriptions which incorporate the CSS2 definition of the same property. In CSS2, "boxes" are generated by "elements" in the same way that XSL areas are generated by formatting objects. Any references in the CSS2 definition to "boxes" are to be taken as referring to "areas" in the XSL area model, and where "element" appears in a CSS2 definition it should be taken to refer to a "formatting object".
The position and size of a box are normally taken to refer to the position and size of the area's content rectangle. Additional correspondences between the CSS2 Box Model and the XSL Area Model are contained in the following table.
| Box | Area |
| top content edge | top edge of the content rectangle |
| padding edge | padding rectangle |
| content area | interior of the content rectangle |
| padding area | region between the content rectangle and the padding rectangle |
| border area | region between the padding rectangle and the border rectangle |
| background | background |
| containing block | closest ancestor block area |
| caption | area generated by fo:table-caption |
| inline box | inline-area |
| line box | line-area |
| block box | block-area which is not a line-area |
| page box | page-area |
Box margins map to area traits in accordance with the description of how area traits are computed from property values in[5 Property Refinement / Resolution].
XSL Definition:
| Value: | <uri>+ | none | inherit |
| Initial: | none |
| Applies to: | fo:root |
| Inherited: | no |
| Percentages: | N/A |
| Media: | all |
Values have the following meanings:
The source document is transient, unknown, or unspecified.
A list of space-separated URIs, indicating the XML document(s) used as input to the stylesheet.
This property provides a pointer back to the original XML document(s) used to create this formatting-object tree. It is useful for for alternate renderers (aural readers, etc) whenever the structure of the formatting-object tree is inappropriate for that renderer.
XSL Definition:
| Value: | <string> | none | inherit |
| Initial: | none |
| Applies to: | see prose |
| Inherited: | no |
| Percentages: | N/A |
| Media: | all |
It is used by all formatting objects that can be contained in fo:flow or fo:static-content (all formatting objects that can be directly created from an XML source element).
Values have the following meanings:
Indicates that no semantic tag is cited by this formatting object.
The value is a string representing a semantic that may be used in rendering this formatting object. It can, for example, be an element name in some known semantic vocabulary, such as HTML, or a particular Web Accessibility Initiative (WAI) semantic vocabulary.
This provides a hint for alternate renderers (aural readers, etc) as to the role and potential alternate presentation of the content of this formatting object.
This property is not inherited, but all subsidiary nodes of this formatting object that do not bear a role property should utilize the same alternate presentation properties. (It is not inherited because knowledge of the start and end of the formatting-object subtree generated by the element may be needed by the renderer.)
XSL Definition:
| Value: | auto | absolute | fixed | inherit |
| Initial: | auto |
| Applies to: | fo:block-container |
| Inherited: | no |
| Percentages: | N/A |
| Media: | visual |
Values have the following meanings:
There is no absolute-positioning constraint. Positioning is in accordance with the relative-position property.
The area's position (and possibly size) is specified with the "left", "right", "top", and "bottom" properties. These properties specify offsets with respect to the area's containing area. Absolutely positioned areas are taken out of the normal flow. This means they have no impact on the layout of later siblings. Also, though absolutely positioned areas have margins, they do not collapse with any other margins.
The area's position is calculated according to the "absolute" model, but in addition, the area is fixed with respect to some reference. In the case of continuous media, the area is fixed with respect to the viewport (and doesn't move when scrolled). In the case of paged media, the area is fixed with respect to the page, even if that page is seen through a viewport (in the case of a print-preview, for example). Authors may wish to specify "fixed" in a media-dependent way. For instance, an author may want an area to remain at the top the viewport on the screen, but not at the top of each printed page.
The following additional restrictions apply for paged presentations:
Only objects with absolute-position="auto" may have page/column breaks.
For other values any keep and break properties are ignored.
The area generated is a descendant of the page-area where the first area from the object would have been placed had the object had absolute-posiiton="auto" specified.
CSS2 Definition:
| Value: | <length> | <percentage> | auto | inherit |
| Initial: | auto |
| Applies to: | positioned elements |
| Inherited: | no |
| Percentages: | refer to height of containing block |
| Media: | visual |
CSS2 Reference: http://www.w3.org/TR/REC-CSS2/visuren.html#propdef-top.
The "top" property specifies how far a box's top content edge is offset below the top edge of the box's containing block.
XSL modifications to the CSS definition:
See definition of property left ([7.4.5 "left"]).
CSS2 Definition:
| Value: | <length> | <percentage> | auto | inherit |
| Initial: | auto |
| Applies to: | positioned elements |
| Inherited: | no |
| Percentages: | refer to height of containing block |
| Media: | visual |
CSS2 Reference: http://www.w3.org/TR/REC-CSS2/visuren.html#propdef-right.
The "right" property specifies how far a box's right content edge is offset to the left of the right edge of the box's containing block.
XSL modifications to the CSS definition:
See definition of property left ([7.4.5 "left"]).
CSS2 Definition:
| Value: | <length> | <percentage> | auto | inherit |
| Initial: | auto |
| Applies to: | positioned elements |
| Inherited: | no |
| Percentages: | refer to height of containing block |
| Media: | visual |
CSS2 Reference: http://www.w3.org/TR/REC-CSS2/visuren.html#propdef-bottom.
The "bottom" property specifies how far a box's bottom content edge is offset above the bottom of the box's containing block.
XSL modifications to the CSS definition:
See definition of property left ([7.4.5 "left"]).
CSS2 Definition:
| Value: | <length> | <percentage> | auto | inherit |
| Initial: | auto |
| Applies to: | positioned elements |
| Inherited: | no |
| Percentages: | refer to height of containing block |
| Media: | visual |
CSS2 Reference: http://www.w3.org/TR/REC-CSS2/visuren.html#propdef-left.
The "left" property specifies how far a box's left content edge is offset to the right of the left edge of the box's containing block.
The values of the four (position offset) properties have the following meanings:
The effect of this value depends on which of related properties have the value "auto" as well. See the sections on the width and height of absolutely positioned, non-replaced elements for details.
The offset is a fixed distance from the reference edge.
The offset is a percentage of the containing block's width (for "left" or "right") or "height" (for "top" and "bottom"). For "top" and "bottom", if the "height" of the containing block is not specified explicitly (i.e., it depends on content height), the percentage value is interpreted like "auto".
For absolutely positioned boxes, the offsets are with respect to the box's containing block. For relatively positioned boxes, the offsets are with respect to the outer edges of the box itself (i.e., the box is given a position in the normal flow, then offset from that position according to these properties).
XSL modifications to the CSS definition:
These properties set the position of the content-rectangle of the associated area.
If both "top" and "bottom" are specified, the height of the content rectangle is overridden. If both "left" and "right" are specified, the width of the content-rectangle is overridden.
CSS2 Definition:
| Value: | <angle> | [[ left-side | far-left | left | center-left | center | center-right | right | far-right | right-side ] || behind ] | leftwards | rightwards | inherit |
| Initial: | center |
| Applies to: | all elements |
| Inherited: | yes |
| Percentages: | N/A |
| Media: | aural |
CSS2 Reference: http://www.w3.org/TR/REC-CSS2/aural.html#propdef-azimuth.
CSS2 Definition:
| Value: | <uri> | none | inherit |
| Initial: | none |
| Applies to: | all elements |
| Inherited: | no |
| Percentages: | N/A |
| Media: | aural |
CSS2 Reference: http://www.w3.org/TR/REC-CSS2/aural.html#propdef-cue-after.
CSS2 Definition:
| Value: | <uri> | none | inherit |
| Initial: | none |
| Applies to: | all elements |
| Inherited: | no |
| Percentages: | N/A |
| Media: | aural |
CSS2 Reference: http://www.w3.org/TR/REC-CSS2/aural.html#propdef-cue-before.
CSS2 Definition:
| Value: | <angle> | below | level | above | higher | lower | inherit |
| Initial: | level |
| Applies to: | all elements |
| Inherited: | yes |
| Percentages: | N/A |
| Media: | aural |
CSS2 Reference: http://www.w3.org/TR/REC-CSS2/aural.html#propdef-elevation.
CSS2 Definition:
| Value: | <time> | <percentage> | inherit |
| Initial: | depends on user agent |
| Applies to: | all elements |
| Inherited: | no |
| Percentages: | see prose |
| Media: | aural |
CSS2 Reference: http://www.w3.org/TR/REC-CSS2/aural.html#propdef-pause-after.
CSS2 Definition:
| Value: | <time> | <percentage> | inherit |
| Initial: | depends on user agent |
| Applies to: | all elements |
| Inherited: | no |
| Percentages: | see prose |
| Media: | aural |
CSS2 Reference: http://www.w3.org/TR/REC-CSS2/aural.html#propdef-pause-before.
CSS2 Definition:
| Value: | <frequency> | x-low | low | medium | high | x-high | inherit |
| Initial: | medium |
| Applies to: | all elements |
| Inherited: | yes |
| Percentages: | N/A |
| Media: | aural |
CSS2 Reference: http://www.w3.org/TR/REC-CSS2/aural.html#propdef-pitch.
CSS2 Definition:
| Value: | <number> | inherit |
| Initial: | 50 |
| Applies to: | all elements |
| Inherited: | yes |
| Percentages: | N/A |
| Media: | aural |
CSS2 Reference: http://www.w3.org/TR/REC-CSS2/aural.html#propdef-pitch-range.
CSS2 Definition:
| Value: | <uri> mix? repeat? | auto | none | inherit |
| Initial: | auto |
| Applies to: | all elements |
| Inherited: | no |
| Percentages: | N/A |
| Media: | aural |
CSS2 Reference: http://www.w3.org/TR/REC-CSS2/aural.html#propdef-play-during.
CSS2 Definition:
| Value: | <number> | inherit |
| Initial: | 50 |
| Applies to: | all elements |
| Inherited: | yes |
| Percentages: | N/A |
| Media: | aural |
CSS2 Reference: http://www.w3.org/TR/REC-CSS2/aural.html#propdef-richness.
CSS2 Definition:
| Value: | normal | none | spell-out | inherit |
| Initial: | normal |
| Applies to: | all elements |
| Inherited: | yes |
| Percentages: | N/A |
| Media: | aural |
CSS2 Reference: http://www.w3.org/TR/REC-CSS2/aural.html#propdef-speak.
CSS2 Definition:
| Value: | once | always | inherit |
| Initial: | once |
| Applies to: | elements that have table header information |
| Inherited: | yes |
| Percentages: | N/A |
| Media: | aural |
CSS2 Reference: http://www.w3.org/TR/REC-CSS2/tables.html#propdef-speak-header.
CSS2 Definition:
| Value: | digits | continuous | inherit |
| Initial: | continuous |
| Applies to: | all elements |
| Inherited: | yes |
| Percentages: | N/A |
| Media: | aural |
CSS2 Reference: http://www.w3.org/TR/REC-CSS2/aural.html#propdef-speak-numeral.
CSS2 Definition:
| Value: | code | none | inherit |
| Initial: | none |
| Applies to: | all elements |
| Inherited: | yes |
| Percentages: | N/A |
| Media: | aural |
CSS2 Reference: http://www.w3.org/TR/REC-CSS2/aural.html#propdef-speak-punctuation.
CSS2 Definition:
| Value: | <number> | x-slow | slow | medium | fast | x-fast | faster | slower | inherit |
| Initial: | medium |
| Applies to: | all elements |
| Inherited: | yes |
| Percentages: | N/A |
| Media: | aural |
CSS2 Reference: http://www.w3.org/TR/REC-CSS2/aural.html#propdef-speech-rate.
CSS2 Definition:
| Value: | <number> | inherit |
| Initial: | 50 |
| Applies to: | all elements |
| Inherited: | yes |
| Percentages: | N/A |
| Media: | aural |
CSS2 Reference: http://www.w3.org/TR/REC-CSS2/aural.html#propdef-stress.
CSS2 Definition:
| Value: | [[<specific-voice> | <generic-voice> ],]* [<specific-voice> | <generic-voice> ] | inherit |
| Initial: | depends on user agent |
| Applies to: | all elements |
| Inherited: | yes |
| Percentages: | N/A |
| Media: | aural |
CSS2 Reference: http://www.w3.org/TR/REC-CSS2/aural.html#propdef-voice-family.
CSS2 Definition:
| Value: | <number> | <percentage> | silent | x-soft | soft | medium | loud | x-loud | inherit |
| Initial: | medium |
| Applies to: | all elements |
| Inherited: | yes |
| Percentages: | refer to inherited value |
| Media: | aural |
CSS2 Reference: http://www.w3.org/TR/REC-CSS2/aural.html#propdef-volume.
The following common-border-padding-and-background-properties are taken from CSS2. Those "border", "padding", and "background" properties that have a before, after, start, or end suffix are writing-mode relative and are XSL-only properties.
CSS2 Definition:
| Value: | scroll | fixed | inherit |
| Initial: | scroll |
| Applies to: | all elements |
| Inherited: | no |
| Percentages: | N/A |
| Media: | visual |
CSS2 Reference: http://www.w3.org/TR/REC-CSS2/colors.html#propdef-background-attachment.
The background-image may scroll with the enclosing object.
The background-image is to be fixed within the viewable area of the enclosing object.
If a background-image is specified, this property specifies whether it is fixed with regard to the viewport (fixed) or scrolls along with the document (scroll).
Even if the image is fixed, it is still only visible when it is in the background or padding area of the element. Thus, unless the image is tiled ("background-repeat: repeat"), it may be invisible.
User agents may treat fixed as scroll. However, it is recommended they interpret fixed correctly, at least for the HTML and BODY elements, since there is no way for an author to provide an image only for those browsers that support fixed. See the section on conformance for details.
XSL modifications to the CSS definition:
The last paragraph in the CSS description does not apply.
CSS2 Definition:
| Value: | <color> | transparent | inherit |
| Initial: | transparent |
| Applies to: | all elements |
| Inherited: | no |
| Percentages: | N/A |
| Media: | visual |
CSS2 Reference: http://www.w3.org/TR/REC-CSS2/colors.html#propdef-background-color.
This property sets the background color of an element, either a <color> value or the keyword transparent, to make the underlying colors shine through.
The underlying colors will shine through.
Any valid color specification.
XSL modifications to the CSS definition:
Issue (color-props):
We plan to include two proposed SVG properties: color-profile and rendering-intent in XSL. We are investigating if there is an extended syntax to specify both ICC and SVG color.
CSS2 Definition:
| Value: | <uri> | none | inherit |
| Initial: | none |
| Applies to: | all elements |
| Inherited: | no |
| Percentages: | N/A |
| Media: | visual |
CSS2 Reference: http://www.w3.org/TR/REC-CSS2/colors.html#propdef-background-image.
This property sets the background image of an element. When setting a "background-image", authors should also specify a background-color that will be used when the image is unavailable. When the image is available, it is rendered on top of the background color. (Thus, the color is visible in the transparent parts of the image).
Values for this property are either <uri>, to specify the image, or "none", when no image is used.
No image is specified.
CSS2 Definition:
| Value: | repeat | repeat-x | repeat-y | no-repeat | inherit |
| Initial: | repeat |
| Applies to: | all elements |
| Inherited: | no |
| Percentages: | N/A |
| Media: | visual |
CSS2 Reference: http://www.w3.org/TR/REC-CSS2/colors.html#propdef-background-repeat.
If a background image is specified, this property specifies whether the image is repeated (tiled), and how. All tiling covers the content and padding areas of a box. Values have the following meanings:
The image is repeated both horizontally and vertically.
The image is repeated horizontally only.
The image is repeated vertically only.
The image is not repeated: only one copy of the image is drawn.
XSL modifications to the CSS definition:
"Horizontal" and "vertical" are defined relative to the reference orientation; "horizontal" is "left" to "right", and "vertical" is "top" to "bottom".
NOTE:Thus for a rotated area the tiling is also rotated. It is, however, independent of the writing mode.
XSL Definition:
| Value: | <percentage> | <length> | left | center | right | inherit |
| Initial: | 0% |
| Applies to: | block-level and replaced elements |
| Inherited: | no |
| Percentages: | refer to the size of the padding rectangle |
| Media: | visual |
If a "background-image" has been specified, this property specifies its initial position horizontally.
Specifies that a point, at the given percentage across the image from left to right, shall be placed at a point at the given percentage across, from left to right, the area's padding rectangle.
NOTE:For example with a value of 0%, the left edge of the image is aligned with the left edge of the area's padding rectangle. A value of 100% places the right edge of the image aligned with the right edge of the padding rectangle. With a value of 14%, a point 14% across the image is to be placed at a point 14% across the padding rectangle.
Specifies that the left edge of the image shall be placed at the specified length to the right of the left edge of the padding rectangle.
NOTE:For example with a value of 2cm, the left edge of the image is placed 2cm to the right of the left edge of the padding rectangle.
Same as 0%.
Same as 50%.
Same as 100%.
XSL Definition:
| Value: | <percentage> | <length> | top | center | bottom | inherit |
| Initial: | 0% |
| Applies to: | block-level and replaced elements |
| Inherited: | no |
| Percentages: | refer to the size of the padding rectangle |
| Media: | visual |
If a "background-image" has been specified, this property specifies its initial position vertically.
Specifies that a point, at the given percentage down the image from top to bottom, shall be placed at a point at the given percentage down, from top to bottom, the area's padding rectangle.
NOTE:For example with a value of 0%, the top edge of the image is aligned with the top edge of the area's padding rectangle. A value of 100% places the bottom edge of the image aligned with the bottom edge of the padding rectangle. With a value of 84%, a point 84% down the image is to be placed at a point 84% down the padding rectangle.
Specifies that the top edge of the image shall be placed at the specified length below the top edge of the padding rectangle.
NOTE:For example with a value of 2cm, the top edge of the image is placed 2cm below the top edge of the padding rectangle.
Same as 0%.
Same as 50%.
Same as 100%.
Writing-mode Relative Equivalent of CSS2 Property.
| Value: | <color> | inherit |
| Initial: | the value of the 'color' property |
| Applies to: | see prose |
| Inherited: | no |
| Percentages: | N/A |
| Media: | visual |
Specifies the color of the border on the before-edge of a block-area or inline-area.
See definition of property border-top-color ([7.6.19 "border-top-color"]).
Writing-mode Relative Equivalent of CSS2 Property.
| Value: | <border-style> | inherit |
| Initial: | none |
| Applies to: | see prose |
| Inherited: | no |
| Percentages: | N/A |
| Media: | visual |
Specifies the border style for the before-edge.
See definition of property border-top-style ([7.6.20 "border-top-style"]).
Writing-mode Relative Equivalent of CSS2 Property.
| Value: | <border-width> | <length-conditional> | inherit |
| Initial: | medium |
| Applies to: | see prose |
| Inherited: | no |
| Percentages: | N/A |
| Media: | visual |
Specifies the border width for the before-edge.
See definition of property border-top-width ([7.6.21 "border-top-width"]).
XSL modifications to the CSS definition:
The following value type has been added for XSL:
A compound value specifying the width and any conditionality of the border for the before-edge.
The .length component is a <length>. The .conditionality component may be set to "discard" or "retain" to control if the border should be 0 or retained if it's associated edge is a leading edge in a reference-area for areas generated from this formatting object that have an is-first value of "false". See [4.3 Spaces and Conditionality] for further details. The initial value of the .conditionality component is "retain".
NOTE:If the border style is "none" the computed value of the width is forced to "0pt".
Writing-mode Relative Equivalent of CSS2 Property.
| Value: | <color> | inherit |
| Initial: | the value of the 'color' property |
| Applies to: | see prose |
| Inherited: | no |
| Percentages: | N/A |
| Media: | visual |
Specifies the color of the border on the after-edge of a block-area or inline-area.
See definition of property border-top-color ([7.6.19 "border-top-color"]).
Writing-mode Relative Equivalent of CSS2 Property.
| Value: | <border-style> | inherit |
| Initial: | none |
| Applies to: | see prose |
| Inherited: | no |
| Percentages: | N/A |
| Media: | visual |
Specifies the border style for the after-edge.
See definition of property border-top-style ([7.6.20 "border-top-style"]).
Writing-mode Relative Equivalent of CSS2 Property.
| Value: | <border-width> | <length-conditional> | inherit |
| Initial: | medium |
| Applies to: | see prose |
| Inherited: | no |
| Percentages: | N/A |
| Media: | visual |
Specifies the border width for the after-edge.
See definition of property border-top-width ([7.6.21 "border-top-width"]).
XSL modifications to the CSS definition:
The following value type has been added for XSL:
A compound value specifying the width and any conditionality of the border for the after-edge.
The .length component is a <length>. The .conditionality component may be set to "discard" or "retain" to control if the border should be 0 or retained if it's associated edge is a trailing edge in a reference-area for areas generated from this formatting object that have an is-last value of "false". See [4.3 Spaces and Conditionality] for further details. The initial value of the .conditionality component is "retain".
NOTE:If the border style is "none" the computed value of the width is forced to "0pt".
Writing-mode Relative Equivalent of CSS2 Property.
| Value: | <color> | inherit |
| Initial: | the value of the 'color' property |
| Applies to: | see prose |
| Inherited: | no |
| Percentages: | N/A |
| Media: | visual |
Specifies the color of the border on the start-edge of a block-area or inline-area.
See definition of property border-top-color ([7.6.19 "border-top-color"]).
Writing-mode Relative Equivalent of CSS2 Property.
| Value: | <border-style> | inherit |
| Initial: | none |
| Applies to: | see prose |
| Inherited: | no |
| Percentages: | N/A |
| Media: | visual |
Specifies the border style for the start-edge.
See definition of property border-top-style ([7.6.20 "border-top-style"]).
Writing-mode Relative Equivalent of CSS2 Property.
| Value: | <border-width> | inherit |
| Initial: | medium |
| Applies to: | see prose |
| Inherited: | no |
| Percentages: | N/A |
| Media: | visual |
Specifies the border width for the start-edge.
NOTE:If the border style is "none" the computed value of the width is forced to "0pt".
See definition of property border-top-width ([7.6.21 "border-top-width"]).
Writing-mode Relative Equivalent of CSS2 Property.
| Value: | <color> | inherit |
| Initial: | the value of the 'color' property |
| Applies to: | see prose |
| Inherited: | no |
| Percentages: | N/A |
| Media: | visual |
Specifies the color of the border on the end-edge of a block-area or inline-area.
See definition of property border-top-color ([7.6.19 "border-top-color"]).
Writing-mode Relative Equivalent of CSS2 Property.
| Value: | <border-style> | inherit |
| Initial: | none |
| Applies to: | see prose |
| Inherited: | no |
| Percentages: | N/A |
| Media: | visual |
Specifies the border style for the end-edge.
See definition of property border-top-style ([7.6.20 "border-top-style"]).
Writing-mode Relative Equivalent of CSS2 Property.
| Value: | <border-width> | inherit |
| Initial: | medium |
| Applies to: | see prose |
| Inherited: | no |
| Percentages: |