In my last article on XSL Formatting Objects (XSL-FO), we took a look at the basics. We created a simple page master with one body region and then wrote some text onto the page. However, XSL-FO offers a lot more functionality and flexibility. In this article, we'll take a closer look at regions.
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:block>Title of a Book</fo:block>
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.