XSL Formatting Objects

XSL -FO ( Extensible Stylesheet Language - Formatting Objects ) is an XML application that describes, can be arranged such as text, images, lines and other graphical elements on a page. Using XSL -FO documents can not only format for display on screens, but also for high-quality print products on paper. Using XSL -FO documents can even be formatted for reading on a voice synthesizer.

XSL -FO is part of XSL specification from the W3C.

Properties

XSL -FO is a page description language that has its roots in DSSSL, and was occasionally developed in parallel with CSS. The key differences between XSL -FO and CSS are the side model (regions in XSL -FO, box model in CSS) and the process model ( two-stage processing using XSLT and then the layouting with XSL-FO formatters on the one hand and the ad - hoc formatting with CSS renderers on the other). XSL -FO contains elements and attributes for the following aspects:

  • Regions, edges and areas of a page,
  • Width and height of pages
  • Sequence of pages,
  • Page numbering,
  • Borders, spacing, columns, and blocks,
  • Paragraphs, lists and tables,
  • Text formatting such as record formats and separation,
  • Lines, images and other objects
  • And much more.

The list is, especially with regard to XSL 1.1, by far incomplete.

XSL -FO is not designed for text processing, but for professional printing, so the functionality of these two techniques is difficult to compare. Referring to XSL -FO XSLT transformation language but added, many functions of today's text processing systems can be simulated with the two languages ​​. This one has one language for representation ( through XSL -FO ) and processing logic (XSLT ), text processing systems group both tasks usually together in one language and in one place.

For the generation of PDF, RTF, ASCII text and other print media from a XSL-FO file are called FO processors. A popular program is FOP ( Formatting Objects Processor) from the Apache project (see web link), a Java application that generated from XSL-FO data PDF documents and partially also supports PostScript and PCL. For. NET developments, there is a very limited NFop porting the Java project, which only supports the PDF output format. In many industries, however, commercial formatters are used, the support for a greater part of the specification, on the other hand, contain their own extensions that are not absolutely necessary part of XSL -FO, but for practical use, such as other output formats.

Method

The starting point is an XML document that is transformed into an XSL - FO file using XSLT stylesheets. The XSLT stylesheet selects the source document of the required elements and transforms them into a combination of XSL-FO elements and attributes ( the FO tree). These define the appearance in the target medium length (for example page design, design of columns, lists, tables, etc.). This process is repeated until the original document is completely processed. In a second step, a suitable formatter generates (also FO processor called ) the desired target file (eg PDF, RTF or PostScript).

Example

The following example defines an A4 page with the text " Hello world! "

          < fo: simple-page - master master -name = "A4"                              page- width = " 210mm " page-height = " 297mm " >                < / fo: layout -master- set>      < - ( in versions < 2.0 "master -name" ) ->             Hello world!           < / fo: root > literature

  • GK Holman: Definitive XSL -FO, Prentice Hall, ISBN 0-13-140374-5.
  • Manfred Krüger: XSL -FO - understand and apply, Dpunkt Verlag, ISBN 3-89864-394-8.
  • Elke Niedermair, Michael Niedermair: XML for print and screen, Francis, ISBN 3-7723-7735-1.
  • Alfred Nussbaumer, August Mistlbacher: XML Ge Packt Mitp, ISBN 3-8266-0690-6.
  • Dave Pawson: XSL -FO, O'Reilly, ISBN 0-596-00355-2.
  • Manuel Montero Pineda, Manfred Krüger: XSL -FO in practice, Dpunkt Verlag, ISBN 3-89864-249-6.
  • Marco Skulschus, Marcus Stone re: XSL -FO for PDF and print, Mitp, ISBN 3-8266-1531 -X.

Software

  • Apache FOP ( Formatting Objects Processor) - Open Source, Apache License, Version 2.0
  • Antenna House Formatter - commercially
  • RenderX XEP - commercially
  • Xml2PDF server by Altsoft - commercially
  • Xmlroff - Open Source, BSD - license
  • Ecrion XF Rendering Server - commercially
  • Ecrion XF Designer (Visual XSL-FO editor and layout designer for XML data) - commercial
  • JFO - Java Formatting Objects - commercially
  • XSL-FO Formatter speedata - commercially
323244
de