XML
  Home arrow XML arrow Using 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 XSL Formatting Objects
By: Peyton McCullough
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2009-02-04

    Table of Contents:
  • Using XSL Formatting Objects
  • Creating a Hello world document
  • Processing a document
  • Page masters

  • 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 XSL Formatting Objects


    (Page 1 of 4 )

    If you need to format content not just for web pages, but for pages that will actually be printed out, keep reading. There is a technology called XSL Formatting Objects that can help you get the job done. In this article, we'll explain how to use it to format your content appropriately.

    Formatting content or data is for many reasons a key process. Content may be wonderful alone, but if the content isn't formatted, then, to most people, it's worth very little because, to them, it's less welcoming and less accessible. When dealing with formatting content for use on a computer screen, HTML comes to mind. It's one of the most popular and easy-to-use tools available for presenting content on a computer screen.

    However, some things need to be formatted for use on paper, and that presents a challenge. When formatting content for use on a computer screen, the content can simply run down the screen. The formatter doesn't have to worry about page breaks or anything like that. However, with pages, this is different. Only so much content can fit on one page before a new page is needed.

    For this, another technology is needed. There are, of course, various ways to format content for use in print, but one technology really stands out: XSL Formatting Objects, or XSL-FO. XSL-FO is part of the XSL family of technologies, recommended by W3C, and because it's XML-based, it's easy to use, and it's easy to work with alongside other powerful technologies. Using XSL-FO, it's possible to format content for page-based presentation using a familiar XML-based syntax.

    In this article, we'll take a look at using XSL-FO to format content for page-based media.

    The basics of XSL-FO

    As mentioned, XSL-FO is one of the technologies in the XSL (Extensible Stylesheet Language) family. The other two technologies are XSLT for transformations and XPath for addressing the nodes and attributes of an XML document.

    It's perfectly possible to use XSL-FO by itself to create a formatted, page-based document. This is how we're going to initially approach XSL-FO in this article. However, one of the neat things about XSL-FO is that it can be easily used (and was designed to be used) in conjunction with XSLT. Using these technologies together, it's possible to take a regular XML document and transform it into an XSL-FO document using XSLT.

    An XSL-FO document alone, however, does nothing. It simply describes how the formatted page should look. In order to make it useful, you need to use an XSL-FO processor. The processor takes the XSL-FO file and converts it into a format that is immediately useful. You can process it into all sorts of formats, such as images or rich text documents, but the most fitting result is probably a PDF file.

    There are a number of XSL-FO processors available, some free and some commercial. Apache FOP (Formatting Objects Processor) is a popular option. We'll cover using Apache FOP in a bit.

    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 3 Hosted by Hostway
    Stay green...Green IT