Next / Previous / Contents / Shipman's homepage

5. Internal design

Design proceeds in these stages:

5.1. Toolchain selection

Python is a good open-source language perfectly suited to all the tasks here.

For parsing the input DocBook-XML 5.0 file, we'll use Python's lxml module, as described in Python XML processing with lxml.

There are many routes to PDF, but the author has some experience with the XSL-FO standard, the eXtensible Stylesheet Language Formatting Objects. The author recommends this book on the subject:

Pawson, Dave. XSL-FO: Making XML Look Good in Print. O'Reilly, 2002, ISBN 0-596-00355-2.

Because an XSL-FO is an XML document, we will use the etbuilder.py module described in Python XML processing with lxml, which is well-suited for building an XML document from scratch. The lxml module is also suitable for parsing the input DocBook document.

We also use fohelpers.py: XSL-FO helper functions for Python, a module to assist in building XSL-FO files. This module is built on top of lxml and supplies the overall structure. Our application then uses etbuilder to add the content.