Herong's Tutorial Notes On XSL-FO and XHTML
Dr. Herong Yang, Version 2.00

XSL-FO Concepts

Part:   1   2 

This tutorial helps you to understand:

  • Area Model
  • Area Tree
  • Page Layouts
  • Formatting Objects

There is a number important concepts used in XSL-FO language:

  • Area Model: A specification of an area, which represents a rectangular area on the output medium, and rendering information.
  • Area Tree: An ordered tree with nodes called areas that contain geometric information for the placement of text, shape, and image, together with rendering information.
  • Page Layout: A specification of layout and pagination constrains on the output medium.
  • Formatting Object: A semantic element in the XSL-SO language.

Area Model

Area: A rectangular area on the output medium, with a set of parameters, called traits.

An area has three layers:

-------------------
|     Border      |
| --------------- |
| |   Padding   | |
| | ----------- | |
| | | Content | | |
| | ----------- | |
| |             | |
| --------------- |
|                 |
-------------------

An area has many traits for either rendering purposes or formatting purposes. Examples of traits are:

  • "background-color": Specifies the background color of this area.
  • "font-size": Specifies the size of the font used for the text enclosed in this area.
  • "text-align": Specifies the alignment of the text enclosed in this area.

On the output medium, areas can be stacked in two different directions:

  • "inline-progression-direction": A direction in which the reader should go to get the next formatted information.
  • "block-progression-direction": A direction in which the reader should go to get the next formatted information, when the end is reached in the inline progression direction.

If the western language writing style is used, the inline progression direction is from left to right, in which you are reading letters of words within a line. The block progression direction is from top to bottom, in which you will find your next line of text.

Based on the stacking directions, areas are divided into two types:

  • Inline Area: An area to be stacked in the inline progression direction. One character within a line of text printed on a page is a good example of inline areas.
  • Block Area: An area to be stacked in the block progression direction. One line or one paragraph of text printed on a page is a good example of block areas.

Area Tree

Area Tree: An ordered tree of areas. In an area tree, the root node represents the entire area of the output medium, a non-leaf node represents the area produced by stacking all its child nodes together, and a leaf node represents a single area.

Let's use a single simple page of printed text to illustrate the area tree concept:

Root: The entire page, a block area
|
|- Node: Paragraph 1, a block area
|  |- Node: Line 1, a block area
|  |  |- Leaf: Letter 1, a inline area
|  |  |- Leaf: Letter 2, a inline area
|  |  |- ...
|  |- Node: Line 2, a block area
|  |- ...
|
|- Node: Paragraph 2, a block area
|
|- ...

Area tree also allows certain area traits to be inherited from the parent area to the child areas.

(Continued on next part...)

Part:   1   2 

Dr. Herong Yang, updated in 2006
Herong's Tutorial Notes On XSL-FO and XHTML - XSL-FO Concepts