Area Models

Templates are an essential part of stylesheets that are designed for transformation. However, there are also some mechanisms that are used primarily by stylesheets designed for formatting. Area models are conceptually important for using stylesheets as a formatting mechanism. When the XSL processor creates formatted output based on the transformations in your stylesheet, it is creating a specialized type of result tree called the area tree.

The area tree consists of formatted rectangular areas based on the information specified in your stylesheet.

Every area has three parts, which can be manipulated by the stylesheet mechanism:

  • Content-rectangle— This is the rectangle that actually bounds the content of the node processed.

  • Padding— As with a table cell, this represents the area between the content rectangle and the border.

  • Border— This is the border area of the content-rectangle, similar to the border of a table cell.

There are four types of general areas that are used to describe the formatted page:

  • Regions— Regions describe broad areas on a page—for example, a page in a word processor might have three regions, such as a header, body, and footer. However, in XSL, there are actually a number of regions: In addition to top, bottom, and left and right margins, there is a region-body that is the document body, and it is bounded by a region-before, region-after, region-start, and region-end. The relationship of these regions is shown in Figure 8.1.

    Figure 8.1. The relationship between the region area elements in XSL.

  • Block areas— Block areas are areas that represent block-level elements, such as a paragraph of text. Block elements are placed into regions for the sake of formatting.

  • Line areas— Block areas are composed of line areas. For example, a line of text in a paragraph would be a line area. Line areas are composed of inline areas and inline spaces.

  • Inline areas— Inline areas are the building blocks, such as characters, which together form line areas.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.226.165.247