By Dave Pawson
Price: $34.95 USD
£24.95 GBP
Cover | Table of Contents | Colophon
fo namespace. Future implementations may indeed
provide other delivery forms as an endpoint in an XML-based toolchain
in today's organizations. The FO vocabulary is
primarily for the implementors and, in the future, may even become an
invisible stage (to the end user) as more graphical tools become
available.
1. The transformation language for transforming SGML documents marked up in accordance with one or more DTDs into other SGML documents marked up in accordance with other DTDs . . . .2. The style language, where the result is achieved by applying a set of formatting characteristics to portions of the data, and the specification is, therefore, as precise as the application requires, leaving some formatting decisions, such as line-end and column-end decisions, to the composition and layout process.
http://www.nextsolution.co.jp/English/index.html).
They recently announced the release of Version 2.0. Their initial
release followed Jade in 1998.
border. The border
property is a shorthand property for setting the same width, color,
and style for all four borders — top, bottom, left, and
right — of a box. Section 7.29 of the specification lists them
all. The visual ones are shown here:
background
|
border-bottom
|
background-position
|
border-color
|
border-left
| |
border-bottom
|
border-right
|
border-style
| |
|
|
fo namespace.
fo namespace, or XSL-FO stylesheets, consist of
two major parts. The first part describes the general layout of all
possible pages and provides instructions to the formatter regarding
which page templates to use. The second part assigns the actual
content of the document to the pages and describes the formatting of
the content. The general pagination problem
consists of properly and fully constructing the first part and in
making the proper assignment of content flows.
This chapter will cover all of this in detail. The formatting of
content remains for subsequent chapters.
fo:root
element.
fo:root element is
the source-document
, which has been added such that the
source document may be accessed from the XSL-FO document.
It's a good habit to pass this to the XSLT
stylesheet as a parameter for inclusion.
fo:root element consist of:layout-master-set
declarations
page-sequence
declarations
element, if used, contains one or more
color-profile children.
declarations are a wrapper for formatting objects
whose content is to be used as a resource to the formatting process.
This element groups global declarations for the FO file. See Chapter 7 for a discussion on color profiles.
layout-master-set
corresponds to the first major part of
an FO file that I mentioned earlier. Its function is to fully specify
the pages to be used in the document. The children of this element
consist of
simple-page-master
elements and
page-sequence-master
elements. You must have at least one
simple-page-master defined. It is good practice to
organize your simple-page-mastersimple-page-master element for this page
description. Any discussion of page masters presupposes the concept of
a page. It may seem self-evident at this point that we
do have a page, but there is actually more to
this concept in XSL than immediately meets the eye.
page-width
and
page-height
attributes on
the simple-page-master element. In a production
context, these attributes are obvious candidates for XSL
parameterization. A simple model of the page is illustrated in Figure 3-2. Note that the labeling of the outer regions
supposes a left-to-right, top-to-bottom (lr-tb) writing mode.
simple-page-masters, but now it is time to examine
complex pagination. What mechanism is available to us to specify the
sequence of simple-page-masters that will be used
to format a given page-sequence and the flows
contained within it? For this purpose, XSL 1.0 provides the
page-sequence-master element.
page-sequence-master may be used to vary the
selection of page masters.
page-sequence may select a
simple-page-master
directly, using the
master-name attribute. This
simple-page-master then generates every page
required by the flows contained in that
page-sequence. In other words, the page master is
referenced as many times as is needed. This is shown in Figure 3-6.
page-sequence may alternatively select a
page-sequence-master, also through use of the
master-reference attribute. The
master-reference on the
page-sequence matches the
master-name on the
page-sequence-master. This is most often useful
when the layout goes beyond the simple, single layout needs,
requiring varying simple-page-master usage, as is
the case when recto and verso pages differ.
page-sequence is not constrained to use a
page-sequence-master that has not been used
already. page-sequence-masters are not stateful,
in this sense, and effectively
"reset" themselves when called upon
to supply page-masters to a new
page-sequence.
page-sequence-master is a container for
so-called
sub-sequence-specifiers
,
which, by definition, are children of the
page-sequence-master. Each of the
sub-sequence-specifiers defines a subsequence of
the page-sequence in question; the sum of all
subsequences is the sequence of pages that results from completely
formatting the flow in that page-sequence.
page-sequence-master and its contents:
page-sequence-master
fo:page-sequence — its children, the
page-masters to which it points in one fashion or
another — that pertain to how sequences of pages are married with
their page-masters. I have also talked at length
about the structure of a page. I have left out several properties
that deal with page numbering, but I'll introduce
them soon. There are also two other properties that I will talk about
that introduce elements of internationalization.
initial-page-number
property fixes the page number for the
first page of the page-sequence to which it
applies. The values of the property and its interpretation are listed
as follows:
auto
page-sequence, the initial
page number becomes 1. If it is not the first
page-sequence, the initial page number of the
current page-sequence becomes the page number of
the last page of the preceding page-sequence, plus
1. That is, it simply continues numbering pages sequentially.
auto-odd
auto. If the resulting value is even, add 1.auto-even
auto. If the resulting value is odd, add 1.[number]
<fo:page-sequence master-reference="chapter" initial-page-label="51" ...
page-sequence has no value specified
for initial-page-number, the default of
auto is used, and hence, the first page is
numbered as 1.
force-page-count
property imposes a condition on the
number of pages in a page-sequence. This number
may be an absolute count or a parity condition. For each condition,
if the condition is not satisfied, one page is added to the current
page-sequencefo:block element produces two areas
if split by a page break, as shown in Figure 4-1.
color property unambiguously defines a trait with
the same name. But there are several cases where relations between
properties and traits are more complicated; they will be considered
later.
fo:block element produces two areas
if split by a page break, as shown in Figure 4-1.
color property unambiguously defines a trait with
the same name. But there are several cases where relations between
properties and traits are more complicated; they will be considered
later.
inline-progression-direction (see Chapter 6). Inline-areas are placed inside other
inline-areas or inside line areas. The following
objects
create only inline-areas: fo:character,
fo:inline, fo:inline-container,
fo:bidi-override, fo:leader,
fo:external-graphic,
fo:instream-foreign-object,
fo:page-number, and
fo:page-number-citation.
block-progression-direction (see Chapter 5). The following objects
create only block-areas: fo:block,
fo:block-container, fo:table,
fo:table-and-caption, and
fo:list-block.
text-altitude
and
text-depth
: they specify the
inline-progression-dimension of glyph-areas and
are used in line-stacking calculations. These are the low-level items
that determine the area sizes.
text-altitude
text-depth
start-indent and
end-indent traits of all descendant normal
block-areas.
reference-orientation (normal areas can change
inline-progression-direction only via the
direction property or bidi
mechanism).
display-align trait can be set to align their
contents in the block-progression-dimension.
fo:block
elements are normal. table-cell is a reference
area; label and body of a list
item are normal. Only three formatting objects can explicitly
generate reference areas:
fo:table-cell
fo:block-container
fo:inline-container
border-after-width.conditionality, for
instance. The values are either retain or
discard, and affect the border or padding when it
is at the beginning or the end of a reference area. This can cause
problems when you actually want the border or padding at the before
or start side, and the conditionality is set to
discard (the default). It is explained further
when I discuss space resolution in Section 4.5.4.
border-after on six successive areas,
with the final one ending a chapter, this may be discarded (default)
by the formatter, because its area will be lost in the break before
the start of the next chapter. Similar logic works in the
inline-progression-directionfo:block could
be called the basic building block of page content. Simply inserting
content into an fo:block element produces a simple
paragraph style with all the default properties. Blocks are most
commonly used within the page layout you have specified, specifically
within the fo:flow element.
fo:block
fo:block-container
fo:list
fo:table
block-progression-direction, visually separated by
a new line. I'll cover each of these in turn.
block consists of other
blocks, inlines, or textual content. The simple block, acting as a
paragraph, is
likely to be your most used element in the fo
namespace, for normal text-heavy documents. Note that the same
fo:block may be used for any content that requires
whitespace separation in the
block-progression-direction. This ranges from the
title of a document on a page by itself to list item contents. The
block is a versatile element.
para elements in an XML source document, styles
them as blocks with no start indent, has fairly typical spacing
between its predecessor and successor, uses the Times font, and has
simple content. The
border around the
block is simply to outline its area, as I'll be
referring to this again.
fo:block could
be called the basic building block of page content. Simply inserting
content into an fo:block element produces a simple
paragraph style with all the default properties. Blocks are most
commonly used within the page layout you have specified, specifically
within the fo:flow element.
fo:block
fo:block-container
fo:list
fo:table
block-progression-direction, visually separated by
a new line. I'll cover each of these in turn.
block consists of other
blocks, inlines, or textual content. The simple block, acting as a
paragraph, is
likely to be your most used element in the fo
namespace, for normal text-heavy documents. Note that the same
fo:block may be used for any content that requires
whitespace separation in the
block-progression-direction. This ranges from the
title of a document on a page by itself to list item contents. The
block is a versatile element.
para elements in an XML source document, styles
them as blocks with no start indent, has fairly typical spacing
between its predecessor and successor, uses the Times font, and has
simple content. The
border around the
block is simply to outline its area, as I'll be
referring to this again.
<xsl:template match="para">
<fo:block
border-style="solid"
border-width=".1mm"
font-family="Times"
font-size="12pt"
space-before="12pt"
space-after="12pt"
text-align="justify">
<xsl:apply-templates/>
</fo:block>
</xsl:template>break-before
and break-after set
to the value page, and the
space-before.conditionality set to
retain. Example 5-12 shows a
specific example of this practice.