Multiple XSL-FO Flows






Initial version.


Currently the ePublisher PDF - XSL-FO emits all content in one of four different flows: Title page, TOC, Content, Index. This project is related to the need to put content in one or more flows that are not represented by one of these four.

Current Processing Workflow

The PDF XSL-FO format currently provides facilities for emitting content on a title page, TOC, Index, and Content region. This is fairly straightforward since all of the ePublisher formats use some variation of the this view of the world. The PDF - XSL-FO format is unique in that rather than emitting output pages during the Pages pipeline, all content processed during the Pages pipeline is subsequently stitched in a pipeline which handles emitting the various flows into a single XSL-FO file (*.fo) which is finally passed to the Apache FOP engine for processing to PDF.

PDF - XSL-FO processing flow

New Workflow

The new workflow will require a diversion. Rather than all content being prepped and tagged with pages:*:output, content will need to be "chunked". It may be the case that all processing still happen in the current XSL transforms. However, rather than dumping all output to a single file, the Pages processing may need to emit multiple files, for each of the referenced flows.

Alternatively, the same model may be used. However, each segment of content will be wrapped in a container which specifies the flow to which it belongs. When the content is stitched using the page template, the Pages output will be queried for content from each of the flows designated in the page template.

Such an approach introduces the need for dynamically named replacements. This will be related to the next section which will cover how to indicate in the User Interface which content should be emitted in which flows. Regarding the technology of the implementation, a page replacement will need to be created with a name which is not hard-coded (as all replacement names currently are) for each chunk which appears in the Page output. One reason this approach doesn't stink, is that replacements are defined without regard to order. The page template itself will provide structure into which these chunks are emitted.

PDF - XSL-FO processing flow

How to Specify Which is Which

The mechanisms that webworks has traditionally used for this configuration are source Markers and Paragraph styles. There doesn't appear to be any reason to change this. An FTI option may be added to paragraphs which will allow a user to specify the name of a flow into which that paragraph and subsequent paragraphs should be emitted. If no custom name is specified, the default flow is used. If a custom name is specified, all subsequent content will be emitted into the flow with the custom name, until a style is encountered which "resets" the content to the default flow.

When using a marker, the end of a document will mark the end of a custom flow. This means that each source document will need to explicitly specify if its content is to appear in a custom flow.


DevCenter/Projects/Multiple XSL-FO flows (last edited 2011-03-29 23:50:53 by JesseWiles)