ITworld.com
  Search  
Menu Changing the way you view IT
XML Dressed to Kill: Flow Objects
Sign up for XML IN PRACTICE
More Newsletters
 
 

XML IN PRACTICE --- 03/29/2001



Mark Johnson

Many people consider XSL a language for turning XML into HTML. They think of and use XSL as a high-octane version of CSS (Cascading Style Sheets). Besides being a fully functional (pun intended) programming language though, XSL, in a sense, is two languages.
Advertisement
On this topic




You probably know about XSLT, which transforms XML to produce a new structure (usually another XML or HTML document). XSL Flow Objects (XSL- FO) is XSL's more obscure half; it turns XML into high-quality print.

Flow objects stem from DSSSL, SGML's LISP-like style language. XML-FO is an entire language that describes page geometries such as page sizes, printable areas, headers, footers, margins, gutters, and columns. XSL-FO lets you describe the layout of such page elements in minute detail that you can specify the page areas designated for text and "flow" text into them, like water flowing into a pitcher. Having such strictly defined objects allows a page to be very precisely described.

The XSL-FO language uses tags for just about any tool you use to put ink on a page. You can control columns and gutters, font styles and sizes, kerning, borders, colors, lines with end caps, page breaks, images, text block alignment, and justification.

XSL-FO can be intimidating at first because you have to learn some background concepts like "layout masters" and "page sequences". Once you understand the basic model though, writing XSLT stylesheets that transforms your XML document to XSL-FO (which itself is another XML format) is easy.

But what can you do with an XSL-FO file? Since the XSL-FO definition so strictly defines the XSL-FO tags, page-rendering software can read XSL- FO files and produce high-quality graphical representations of the documents. Also, a conversion program can read the XSL-FO definition and convert it to PDF, PostScript, TeX, or any other page description language, and then print or display it.

At least two XSL-FO-to-PDF rendering products now exist. The Apache Software Foundation offers FOP, a Java implementation of an XSL-FO-to- PDF renderer. As open-source freeware, you can modify FOP's source code and contribute to the program once you downloaded the binary form from http://xml.apache.org/fop/index.html. You do, however, need Java and some other components to run FOP.

XEP is an excellent and clear introduction to XSL-FO produced by RenderX. XEP is a commercial option but a free evaluation version is available at http://www.renderx.com/FO2PDF.html. RenderX also offers an XSL-FO tutorial at http://www.renderx.com/tutorial.html.

XSL-FO gives you professional control of your page layout. If you have XML data sources that you'd like to style, then consider using XSL-FO to format your XML for formatting and printing.

 

Mark Johnson is president of Elucify Technical Communications, a Colorado-based training and consulting company dedicated to clarifying novel or complex ideas through clear explanation and examples.

Sponsored links
Locate Hidden Software on business PCs with this free tool
Bring harmony to your mix of UNIX-Linux-Windows computing environments
Top 5 Reasons to Combine App Performance and Security
KODAK i1400 Series Scanners stand up to the challenge
www.itworld.com    open.itworld.com     security.itworld.com     smallbusiness.itworld.com
storage.itworld.com     utilitycomputing.itworld.com     wireless.itworld.com

 
Contact Us   About Us   Privacy Policy    Terms of Service   Reprints  

CIO   Computerworld   CSO   GamePro   Games.net   IDG Connect   IDG World Expo   Industry Standard   Infoworld   ITworld   JavaWorld   LinuxWorld  MacUser   Macworld   Network World   PC World   Playlist  

Copyright © Computerworld, Inc. All rights reserved

Reproduction in whole or in part in any form or medium without express written permission of Computerworld Inc. is prohibited. Computerworld and Computerworld.com and the respective logos are trademarks of International Data Group Inc.