DocBook to Word Conversion?

rudimenter picture rudimenter · Jun 9, 2011 · Viewed 8.7k times · Source

I need some help with conversion of DocBook files to Microsoft Word files.

Do I need an XSL file for the transformation?

Answer

martin jakubik picture martin jakubik · Jun 20, 2011

Yes, you do need an XSL file. You can get XSL files for DocBook from the free DocBook XML distribution. Then, you run a free XSLT transformer such as Saxon. If you run Saxon from a command line, you give it the name of your DocBook file, and the name of one of the stylesheets, and it will transform your file according to the rules in the stylesheet.

What you need to do to transform to Word, is to pick the right stylesheet.

From DocBook XSL: The Complete Guide, here are three possibilities:

  • Convert to XSL-FO and then use the XMLmind to export to Word. See the XMLmind website for more information.
  • Use a limited set of tags and then use one of DocBook XML's included stylesheets to output to WordML.
  • Try to use Jfor to output to RTF, although Jfor no longer appears to be maintained.

And I have one of my own:

  • As above, use one of DocBook XML's included stylesheets to publish to XSL-FO, then run Apache FOP to convert from XSL-FO to RTF. You will lose the structural information, but you will keep a certain amount of the formatting.