• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

DocBook: A simple way to create HTML, PDF

Ranch Hand
Posts: 270
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I have created a docBook XML document and want to convert the version to HTML and PDF. Is there a simple way to do that?

Thanks in advance.
Ranch Hand
Posts: 1855
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jeppe,

there is no simple way .

But that doesn't mean to give up. Because once you went through some hardship you will enter a new area you never have imagined before

You need XSL to give your XML style like in HTML, PDF or other. This is valid for any XML document. DocBook XML is also only pure XML.

Now for DocBook XML there is DocBook XSL. You don't need to create your own XSL. You can find the DocBook XSL library here.

The next step is to merge DocBook XML with DocBook XSL so that at the end of the merging process you get your HTML or PDF.

We call it a toolchain that has to be setup in prior before you can pipe your XML document through. You can choose between a number of processors who convert your XML documents to HTML or PDF. There are commercial and non-commercial processors out.

I use two non-commercial processors, Saxon for HTML and FOP for PDF.

Below you can see the flow your XML go through:

XML + XSL -> Saxon -> HTML
XML + XSL -> Saxon -> FO -> FOP -> PDF

Once you setup the whole toolchain, which can be hard depending o how much you know about all the stuff, you will love it. Because you make this toolchain setup only once. The rest will be just to write content over content.

Here are the most important links for DocBook XML + XSL: DocBook 5.0: The Definitive Guide and DocBook XSL: The Complete Guide

Good Luck!
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic