Page 1 of 1

DocBook to DITA transform creates empty <dita>

Posted: Tue Nov 14, 2017 8:46 pm
by jerrypope
I've tried to convert three different DocBook documents into DITA topics but none of them contain actual content. All I get is the following:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE dita
PUBLIC "-//OASIS//DTD DITA Composite//EN" "../../../../dtd/ditabase.dtd">
<dita/>

I get no errors, other than Saxon complaining about the empty <dita>.

During processing I see several of the following types of message:
System ID: C:\Program Files\Oxygen XML Editor 18\frameworks\docbook\5.0\tools\db4-upgrade.xsl
Description: [Saxon-EE] Converting ulink to uri. (preface)
Start location: 1390:0

What am I missing? Why is there no usable content?

Thanks for any hints that you can provide.

Jerry Pope
Oracle Corp.

Re: DocBook to DITA transform creates empty <dita>

Posted: Wed Nov 15, 2017 9:11 am
by Radu
Hi Jerry,

What version of Oxygen are you using? 18.0 or 18.1?
What version of Docbook documents are you converting? 4 or 5?
If you can post a small sample Docbook file or send it to us via email (support@oxygenxml.com) we could try to look into this.

Regards,
Radu

Re: DocBook to DITA transform creates empty <dita>

Posted: Wed Nov 15, 2017 6:19 pm
by jerrypope
Hello Radu,

I'm using oXygen 18.1.
To answer your question about which version of DocBook we're using, I've had to ask the writing team. I personally don't know. Should have an answer within a few hours.

Important! I left out a significant piece of information for which I'm embarrassed! I should have included the fact that the writers are using a hybridized version of DocBook called SolBook.

As I'm really new to this forum, I'm not familiar with posting files. I'll try to post two simple XML documents (and the SolBook DTD) for you to look at. If I'm not able to post them, I'll email them to you. Those two documents represent the XML library that I need to convert to DITA.

Jerry Pope

Re: DocBook to DITA transform creates empty <dita>

Posted: Wed Nov 15, 2017 7:18 pm
by jerrypope
Seems no one knows for sure which version of DocBook the SolBook DTD is based on. The DTD was created a long time ago, so I'd guess that it was based on DocBook 4 (or maybe even an earlier version). No one knows.

Hopefully you received the files that I sent. I sent them about 45 minutes ago.

Jerry

Re: DocBook to DITA transform creates empty <dita>

Posted: Thu Nov 16, 2017 12:35 pm
by Radu
Hi Jerry,

Thanks for the samples.
Indeed what you are using is not Docbook, but it's close.
The Docbook to DITA convertor has two stages, the first one converts the Docbook to Docbook5 and the second one does the actual conversion.
Right now the first stage ignores the title set in the original content and the second stage ignores everything.
I can give you some XSLT changes which might help with the conversion:

1) Open the XSLT "OXYGEN_INSTALL_DIR/frameworks/docbook/5.0/tools/db4-upgrade.xsl" find this XSLT template:

Code: Select all

<xsl:template match="dedication|preface|chapter|appendix|part|partintro
                     |article|bibliography|glossary|glossdiv|index
           |reference[not(referenceinfo)]
                     |book" priority="200">


and modify its @match attribute value to also match possible SolBook root elements:

Code: Select all

<xsl:template match="dedication|preface|chapter|appendix|part|partintro
                     |article|bibliography|glossary|glossdiv|index
           |reference[not(referenceinfo)]
                     |book|topicgroup|topic|task" priority="200">


2) Open the "OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT/plugins/dbdita/db2dita/dbReader.xsl", find the template:

Code: Select all

<xsl:template match="/|*[appendix or article or bibliography or book or
            chapter or colophon or dedication or glossary or glossdiv or
            glossentry or msgset or msgentry or part or partintro or
            preface or qandaset or reference or refentry or sect1 or sect2 or
            sect3 or sect4 or sect5 or section or set or simplemsgentry or
            simplesect or task]"
        mode="topic.topic.in">
  <xsl:param name="container"/>
  <xsl:param name="isRequired"/>
  <xsl:apply-templates select="appendix|article|bibliography|book|chapter|
            colophon|dedication|glossary|glossdiv|glossentry|msgset|msgentry|
            part|partintro|preface|qandaset|reference|refentry|sect1|sect2|
            sect3|sect4|sect5|section|set|simplemsgentry|simplesect|task"
        mode="topic.topic.out"/>
</xsl:template>


and replace it with a variant which matches also your additional elements:

Code: Select all

<xsl:template match="/|*[appendix or article or bibliography or book or
            chapter or colophon or dedication or glossary or glossdiv or
            glossentry or msgset or msgentry or part or partintro or
            preface or qandaset or reference or refentry or sect1 or sect2 or
            sect3 or sect4 or sect5 or section or set or simplemsgentry or
            simplesect or task or topicgroup or topic]"
        mode="topic.topic.in">
  <xsl:param name="container"/>
  <xsl:param name="isRequired"/>
  <xsl:apply-templates select="appendix|article|bibliography|book|chapter|
            colophon|dedication|glossary|glossdiv|glossentry|msgset|msgentry|
            part|partintro|preface|qandaset|reference|refentry|sect1|sect2|
            sect3|sect4|sect5|section|set|simplemsgentry|simplesect|task|topicgroup|topic"
        mode="topic.topic.out"/>
</xsl:template>


then run the conversion again.

Regards,
Radu