Login | Register   
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
 

Getting Fancy with FOP

The FOP processor performs an interesting stunt: it converts an XSL-FO file into an Adobe Postscript Description Format (PDF) file. Rather than coding XSL-FO documents manually it's far better to create an XSLT document that will handle the transformation.


advertisement
ebster's Dictionary defines a fop as being synonymous with a "dandy," a person (usually male) who spends an inordinate amount of time and effort on dress and appearance, sometimes to ludicrous extremes. Think of the gold-chain-festooned white-polyester clad lounge lizard of the 1970s and you'll get the basic idea. However, as with so many other terms, FOP has resurfaced with a different meaning—as an acronym for the Formatting-Object Processor, part of the Open Source Apache Project. The FOP processor performs an interesting stunt: it converts an XSL-FO file into an Adobe Postscript Description Format (PDF) file.

XSLT and XSL focus on data-centric and document-centric transformations, respectively, but they are related; You need both to create efficient document-to-print transformations. How do XSLT, XSL, and XSL-Formatting Objects (XSL-FO) fit together?

XSL-FO is a page description language. It's a language specifically designed for working with fairly sophisticated page content; consequently, it can be surprisingly difficult to master well. Rather than coding XSL-FO documents manually it's far better to create an XSLT document that will handle the transformation for you. A Little XSL History
PDF files encode detailed information, font content and graphics within a single file, and have become a standard for document display, just as Postscript has become integral in the area of document printing.



The XSL-FO part, on the other hand, requires a little more explanation, as it is a format that many people think they know but really don't. In the late 1990's, as the XML standard was coming together, the W3C Stylesheet working group wanted to create a generalized page description language that would be able to convert an XML document into a presentation. Unfortunately HTML, even as XHTML, isn't apt at detailed presentations, because the very features that make web browser displays convenient, such aslong scrolling panes of information, don't fare especially well when split into individual pages. For example, even simple elements such as headers and footers are problematic. Columns are difficult to format effectively. Specifying print dimensions can be frustrating, because the concept of "width" in a web page is very different from the same concept in most printed output. Finally, HTML is very imprecise, even using CSS positioning, therefore you must add proprietary extensions if you want the output to do more than vaguely resemble the quality of print-only media.

Therefore, the stylesheet group recommended an Extensible Stylesheet Language (or XSL) that would include two components - a descriptive language for formatting specific content, and a transformative language for converting XML into the descriptive language. As it turned out, the simpler of the two languages ended up being the transformation language, which, because it was originally deemed the less essential of the two tasks, was given the name Extensible Stylesheet Language for Transformations, or XSLT. However, as XML has become more data-centric, the role of XSLT as a mechanism for general transformations has become much, much more prominent, while the rest of the XSL specification was relegated to the background. Eventually though, the XSL recommendation was released, in October, 2001—nearly two years after the XSLT recommendation. Because of the extreme prominence that XSLT has achieved, even though the recommendation is titled Extensible Stylesheet Language (XSL), the page-description portion of XSL is commonly called XSL-FO, where FO stands for Formatting Objects (hence FOP).



Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap