XML
  Home arrow XML arrow Page 3 - Using Regions with XSL Formatting Objects
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
XML

Using Regions with XSL Formatting Objects
By: Peyton McCullough
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 2
    2009-06-02

    Table of Contents:
  • Using Regions with XSL Formatting Objects
  • Defining Additional Regions
  • Placing Content Within Regions
  • A Short Example

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    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. 

    More XML Articles
    More By Peyton McCullough


     

    XML ARTICLES

    - 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
    - Simple Web Syndication with RSS 2.0
    - Java UI Design with an IDE







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek