Convert the experimental DITA bookmap to Docbook
Docbook and DITA: Convert the Experimental DITA Bookmap to Docbook
Date: Wed, 24 Nov 2004 17:36:20 -0000 From: ehennum5 <ehennum@us.ibm.com> To: dita-users@yahoogroups.com Subject: [dita-users] Re: DITA Toolkit 1.3.2 Update
Hi, DITA Users:
Just a couple of additions to Don's announcement [about DITA Toolkit version 1.3.2]:
--- In dita-users@yahoogroups.com, "Don R. Day" wrote: > > ... DITA 1.3.2 adds a basic transform for > DITA-to-DocBook conversion. In particular, this experimental > capability should allow adopters to explore whether a book defined in > DocBook could process section content defined as DITA topics.
A couple of strategies to explore might be as follows:
* Maintain the bibliographic definition in DocBook and the content in DITA.
For instance, it would be possible to use DocBook extension mechanisms to add an element to DocBook at the section level that refers to a DITA map or topic. Preprocessing could convert the referenced DITA content to DocBook and replace the referencing element. The result could then be processed with DocBook tools or in DocBook environments.
* Convert the experimental DITA bookmap to Docbook.
To illustrate the second approach, I've appended a sketch of an XSLT transform that could be dropped into the demo/book directory within the latest DITA distribution as an initial basis for the exploration.
Hoping that's interesting,
Erik Hennum
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href="../../xsl/map2docbk.xsl"/>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - BOOKMAP - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <xsl:template match="*[contains(@class,' bookmap/bookmap ')]"> <book> <xsl:copy-of select="@id"/> <!-- doesn't handle reltables or topicgroups --> <xsl:if test="@title"> <title> <xsl:value-of select="@title"/> </title> </xsl:if> <!-- doesn't handle reltables or topicgroups --> <xsl:apply-templates select="*[contains(@class,' map/topicref ')]"/> </book> </xsl:template>
<!-- doesn't handle bkinfo yet --> <xsl:template match="*[contains(@class,' bookmap/bkinfo ')]"/>
<xsl:template match="*[contains(@class,' bookmap/preface ')]"> <xsl:call-template name="topicref"> <xsl:with-param name="element" select="'preface'"/> </xsl:call-template> </xsl:template>
<xsl:template match="*[contains(@class,' bookmap/chapter ')]"> <xsl:call-template name="topicref"> <xsl:with-param name="element" select="'chapter'"/> </xsl:call-template> </xsl:template>
<xsl:template match="*[contains(@class,' bookmap/part ')]"> <xsl:call-template name="topicref"> <xsl:with-param name="element" select="'part'"/> </xsl:call-template> </xsl:template>
<xsl:template match="*[contains(@class,' bookmap/appendix ')]"> <xsl:call-template name="topicref"> <xsl:with-param name="element" select="'appendix'"/> </xsl:call-template> </xsl:template>
</xsl:stylesheet>
Prepared by Robin Cover for The XML Cover Pages archive.