Home arrow XML arrow Page 2 - Using Regions with XSL Formatting Objects
XML

Using Regions with XSL Formatting Objects


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.

Author Info:
By: Peyton McCullough
Rating: 4 stars4 stars4 stars4 stars4 stars / 8
June 02, 2009
TABLE OF CONTENTS:
  1. · Using Regions with XSL Formatting Objects
  2. · Defining Additional Regions
  3. · Placing Content Within Regions
  4. · A Short Example

print this article
SEARCH DEVARTICLES

Using Regions with XSL Formatting Objects - Defining Additional Regions
(Page 2 of 4 )

 

Now let's take a look at the other regions available, one at a time. 

The next region we'll take a look at is the top region. The top region is placed, of course, on the top of the page. This is a page's header. In the case of a page out of a book, the name of the book or chapter might go here.

In order to define this region, the region-before tag is used (this may seem odd, since the area it refers to is more intuitively called the top of the page or the header, but the region contains the content "before" everything else). This tag goes inside of the page master definition, just like the body region definition, but it must be placed after the body region's definition. This holds true for all non-body regions.

Here's a basic example of a master page with two region definitions, one for the body region and one for the top region: 

<fo:region-before />

 The default name for the top region is "xsl-region-before." 

The next logical step here, since we just looked at the top region, is to look at the bottom region. This region is traditionally called the page's footer. The corresponding tag, however, is called region-after, since the region is located after the other regions. Here's an example definition: 

<fo:region-after />

The default name for the bottom region is "xsl-region-after." 

We've now looked at the regions corresponding to the top and bottom of a page. We can also place text on the left and right sides of a page. The region on the left of a page is the left region, and it's defined using the region-start tag: 

<fo:region-start />

Its default name is, of course, "xsl-region-start." 

The region on the right of a page is the right region, and it's defined using the region-end tag: 

<fo:region-end />

 As expected, "xsl-region-end" is the default name. 

Like the top and bottom regions, the names of the left and right regions may seem a bit non-intuitive, but they might make sense if we take a look at exactly where the regions are located on the page. The top region is located before all other regions, and the bottom region is located after all other regions. So, the left and right regions are both located entirely between the top and bottom regions. Think of them as the start and end of this middle section of the page. 


blog comments powered by Disqus
XML ARTICLES

- Open XML Finally Supported by MS Office
- XML Features Added to Two Systems
- Using Regions with XSL Formatting Objects
- Using XSL Formatting Objects
- More Schematron Features
- Schematron Patterns and Validation
- Using Schematron
- Datatypes and More in RELAX NG
- Providing Options in RELAX NG
- An Introduction to RELAX NG
- Path, Predicates, and XQuery
- Using Predicates with XQuery
- Navigating Input Documents Using Paths
- XML Basics
- Introduction to XPath

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials