Monday, September 19, 2005

OpenOffice to DocBook converter

For those who have tried converting OpenOffice/StarOffice documents to DocBook or vice-versa, you probably experienced the pain of trying to get the built in stylesheets to work. I worked on some of the earlier versions of those stylesheets, and the stylesheets still have some obvious problems. There also was no way to limit the styles a user could apply to the document.

A new and promising add-on hopes to make the DocBook/OpenOffice integration easier! Enter ooo2dbk from Indesko. This package supports output to article or book documents that are DocBook 4.3 compliant, using a python script.

I'll provide a review when I get a chance to try it out. I'm also eager to test out the latest OpenOffice 2.0 beta 2, which provides support for XForms!

Update: Thanks to Laurent at Indesko, I was able to get this running on the latest Open Office 2.0 beta 2. You can install the ooo2dbk package by going to Tools > Package Manager. I restarted OpenOffice (to be safe), and the Indesko menu appears with the other menus. I opened the included template, and the ooo2dbk program is available to run from the Indesko menu. After saving the file to a .sxw file, from the command line (I used Cygwin), I ran the following command:

ooo2dbk --article --zipfile=document.zip document.sxw

which created a zip file with images and the DocBook XML file. I validated it in oXygen 6.2, and it worked just fine! I'll try linking to the XSLT directly from Open Office next, so I don't have to use the command line. Give it a try!

See also:

No comments: