Convert Docbook to DITA

Questions about XML that are not covered by the other forums should go here.
AlexVV
Posts: 5
Joined: Wed Oct 06, 2010 10:41 pm

Convert Docbook to DITA

Post by AlexVV »

Hi I've been searching for hours about how i can convert my docbook xml to DITA using a stylesheet. I've got a large help manual which needs to be updated and standardized, originally written using Docbook.

I was wondering if there was a simple stylesheet I could use (with minimal tweaking) so I can convert over?

Thanks!
Radu
Posts: 9055
Joined: Fri Jul 09, 2004 5:18 pm

Re: Convert Docbook to DITA

Post by Radu »

Hi Alex,

There is a DITA Open Toolkit plugin called docbook2dita:
http://sourceforge.net/projects/dita-ot ... p/download
You do not have to install it as it is based on an XSLT stylesheet.
Just download and unzip it and create a transformation scenario in Oxygen on the Docbook file by applying the following XSL stylesheet dbdita/db2dita/docbook2dita.xsl.
This will result in a DITA <dita> composite which you will have to further process to remove validation errors and to split in individual topics.

My suggestion to you is to also ask this question on the DITA users list:
http://tech.groups.yahoo.com/group/dita-users/
Maybe you can find more elaborate advice there.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
AlexVV
Posts: 5
Joined: Wed Oct 06, 2010 10:41 pm

Re: Convert Docbook to DITA

Post by AlexVV »

Thanks, that was really helpful. I'm a bit new to oxygen though, after the transformation, how do I add topic to the new dita composite? and since I'm doing this for a lot of documents, is there a smart search and replace feature that would automate some of this for me?
Radu
Posts: 9055
Joined: Fri Jul 09, 2004 5:18 pm

Re: Convert Docbook to DITA

Post by Radu »

Replicating the message I've already sent on the DITA Users List:

Hi Alex,

This probably happens because the XSL was created to transform Docbook 4 (which does not have a namespace) to DITA and you are probably transforming Docbook 5 (which has a namespace defined) to DITA.

But what you can do:
Open in Oxygen the "db2dita/docbook2dita.xsl" XSL stylesheet and change on the <xsl:stylesheet> the version to "2.0".

Open in Oxygen the "db2dita/dbReader.xsl" XSL stylesheet and change on the <xsl:stylesheet> the version to "2.0".
In the same stylesheet add the following attribute on the root element:
xpath-default-namespace="http://docbook.org/ns/docbook"

Then, in the Oxygen transformation scenario edit dialog change in the "Transformer" combo box the used XSLT transformer to "Saxon EE..."

This should be enough to give you some output in the <dita> composite.

Regards,
Radu

Radu Coravu
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply