Home > Articles > Web Services > XML

DocBook Conversions with XFC

  • Print
  • + Share This
Converting DocBook XML files to other formats requires several tools, time spent configuring those tools, and a bit of work at the command line. Technical writer Scott Nesbitt introduces a different way of converting DocBook files: the XMLmind FO Converter.
Like this article? We recommend

Like this article? We recommend


DocBook XML is a popular way to create documents such as software manuals, reference guides, FAQs, technical articles and reports, and even non-technical books. On their own, DocBook XML files aren't all that useful to their intended audience. To make them useful, you have to convert those files to other formats such as HTML or PDF.

Converting DocBook XML documents into usable formats can be quite a labor-intensive task. First, you need the DocBook XSLT (Extensible Stylesheet Language Transformation) stylesheets, which tell the conversion software how to format the output. To do the dirty work of conversion, you also need an XSLT processor. If you plan to create output for printing, you'll also need an XSL-FO (Extensible Stylesheet Language - Formatting Objects) program.

A number of XSLT and XSL-FO tools are available. Each tool has strengths as well as some noticeable weaknesses and drawbacks. The main problem with most processors is that they run from the command line—you must type a lengthy command string to get them to work. To use the popular Saxon XSLT processor in Linux, for instance, you would type this string:

java com.icl.saxon.StyleSheet -o myDoc.html myDoc.xml /usr/local/db_xsl/docbook-xsl-1.60.1/html/docbook.xsl

Because not all documents are the same, you might also want to add DocBook parameters to command strings like the one above. The parameters control various aspects of the conversion—page size, fonts, and so on. Remembering and typing parameters for every kind of document that you want to convert can become tedious. Of course, you can encapsulate all of the commands and parameters for converting your DocBook files into one or more scripts or batch files, but the problem then becomes keeping track of all of those scripts or batch files.

  • + Share This
  • 🔖 Save To Your Account