Folio - XSL Formatting Objects Renderer

What is Folio?

Folio is a renderer for XML files containing Formatting Object elements as defined in the XSL 1.0 Recommendation. Written in Java, it aims at full conformance with XSL 1.0 and subsequent versions. The initial target renderer is Java 2D, with PDF a second priority.

Folio's initial codebase is forked from XML-FOP's alt-design (FAD). Folio will continue to develop the design ideas of alt-design to full conformance with the Recommendation, while minimising the memory footprint of the rendering process. While FAD was originally written to the Java 1.4 API, Folio is a Java 5.0 project.

Features of Folio's design

Full design documentation will be "translated" to Folio and installed at this site, but notable features include:

XML stream parser
Folio uses a pull or stream parsing model for processing its XML input. A SAX parser "under the hood" supplies parse events on-demand to a parse event buffer. Events of specific types may then be requested from the buffer. This puts control of the parsing process into the hands of the XML consumer, and allows for integrated validation, easing the burden of verifying the context-dependent constraints that occur in the Recommendation.
Stream parsing provides context-awareness during the processing of start-elements, and greatly simplifies the concurrent processing of Folio.
As of Java 6 (Mustang), StAX, the Streaming API for XML, will be incorporated in the JRE. StAX will also become part of JAXP 1.4. When JAXP 1.4 is available, it will be retro-fitted as the foundation of Folio's pull parser.
Concurrent parsing and layout
XML parsing, FO tree (DOM) building, and Area Tree (layout) building all run concurrently. Only as much of the input XML is parsed as is required for the current DOM and layout elements. When no forward references (e.g. Page n of m) are present, the rendering can also proceed in parallel.
Java 2D graphics drawing model
The initial target renderer for Folio is Java 2D Graphics, which will also provide for printing. Clearly, this renderer will use the 2D Graphics model for drawing and rendering marks on the canvas (screen or page). However, building on earlier work in Fop and Batik, Folio will use the 2D Graphic drawing model for all of its renderers.

Why Folio?

In printing, folio is the page number of a book. It is also a sheet of paper folded once to make two leaves of a book, a volume having pages of the largest size, or a leaf of a manuscript or book numbered only on the front side. In the draft version of the XSL 1.1 Recommendation, the concept of page-number has been extended to folio-number.

The First Folio

The most famous folio is the First Folio of the works of William Shakespeare. Published posthumously in 1623, it was the first comprehensive collection of Shakespeare's plays. By kind permission of the Schoenberg Center for Electronic Text & Image at the University of Pennsylvania Library, the Folio logo is taken from the "CATALOGVE" page.

Folio logo 48x48
Penn Library LogoLast modified: 17 January 2007
Folio Logo by permission of Schoenberg Center for Electronic Text & Image