Content Areas

Now that you have an idea of how pages are structured and instantiated by the XSL processor, let's examine how content is arranged on the page. There are three objects that are used to place content on the page: flows, static-content, and blocks. Flows and static-content objects are actually containers, in which blocks can be placed to render the actual content. Let's take a look at these objects and their syntax.

flow and static-content

There are actually two kinds of “flow” objects: flow and static-content.

The flow object is used as a container for block elements that are designed to flow from one page to another, such as the text of a chapter. The control of the flow is determined by the XSL processor, based on the constraints placed on the page using object properties.

static-content is used as a container for content which is not flowed from page to page, but remains static in one region of a page, such as the information we placed in the header and footer of the letterhead example. Because that content is not flowed, it is considered static.

Each flow object can contain multiple block level objects, such as a block, table, list-body, and so on. Each flow object also has a flow-name property, that is used to define the region on the page which the content will be flowed into. The acceptable values for the flow-name include

  • xsl-region-begin

  • xsl-region-end

  • xsl-region-start

  • xsl-region-end

  • xsl-region-body

Each region needs only one flow object, so there should never be more than five flow objects in a sequence.

static-content object elements work similarly to flow objects—there is only one static-content object per region on the page. The primary difference between the static-content object and a flow object is that the content of flow objects is flowed from page to page in the document. However, static-content appears in the same position on every page of the document that is created when the document is rendered. That is what makes static- content appropriate for elements such as headers or footers that are to appear on each page in a document.

Blocks

The content of flow objects and static-content objects includes Block-level objects. Blocks enclose content, such as text or images. Block objects also can be used with a variety of properties to format the text that appears in the block. Properties can be manipulated from block to block, and each block in a flow object is rendered with a line break between the blocks. This makes the block object appropriate for formatting headlines, paragraphs, or a number of text-content types within a document.

For example, in this XSL-FO document, we have three different block elements, each of which contains a small snippet of text. Each of the block objects in our example also makes use of several font properties, so you can see how each block is rendered differently in the final document:

<?xml version="1.0"?> 
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
 <fo:layout-master-set>
  <fo:simple-page-master master-name="title_page">
   <fo:region-body/>
  </fo:simple-page-master>
 </fo:layout-master-set>

 <fo:page-sequence master-name="title_page">
  <fo:flow flow-name="xsl-region-body">
   <fo:block font-size="24pt" font-family="sans-serif">Block One</fo:block>
   <fo:block font-size="48pt" font-family="serif">Block Two</fo:block>
   <fo:block font-size="24pt" font-family="sans-serif">Block Three</fo:block>
  </fo:flow>
 </fo:page-sequence>

</fo:root>

The final rendered output from this stylesheet appears in Figure 10.3.

Figure 10.3. Each of the block objects is rendered on a separate line, and each displays the unique font properties used in the stylesheet.


block objects can be grouped together, using the block-container object as well, to create a reference area of blocks which can then be manipulated as a unit.

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

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