Using Regions with XSL Formatting Objects - Placing Content Within Regions
(Page 3 of 4 )
In order for a region to be of any use, it needs content. For the body region, the flow tag was used to flow content across multiple pages, creating new pages as necessary:
<fo:flow flow-name="xsl-region-body"> <fo:block>Hello, world.</fo:block></fo:flow>
However, for the other regions, flowing doesn't really make sense. In the instance of a book page, the bottom region would contain a simple page number. There is nothing to flow to the next page. This would be confusing, but even if you could envision a scenario where this might be useful, FOP does not support it. All flow elements must point to body regions, or else the processor will refuse to process the document.
Rather than using the flow element to have text flow across pages, then, the content of each non-body region must be static. This makes sense, though. In our book page example, the content of these regions would be more or less uniform throughout the entire book. The top region would contain the book title or the chapter title, and the bottom region would contain the page number. No surprises here.
The static-content element is used for this. It is defined similarly to the flow element, within a page-sequence element. However, any static-content elements must be placed before the flow element.
Let's say that we wanted to fill the top region with the title of a book. The definition would look something like this:
<fo:static-content flow-name="xsl-region-before">
<fo:block>Title of a Book</fo:block>
</fo:static-content>
Again, the difference between the flow element and the static-content element is primarily behavioral, not syntactical. Thus, using static-content elements shouldn't be very difficult.
Next: A Short Example >>
More XML Articles
More By Peyton McCullough