The Docbook to DITA transform

This directory provides the docbook-to-dita transform.

The Docbook-to-DITA transform uses a design pattern that might be called a dialogue transform. This approach makes a strict separation between the input and output logic. Generating an output element requires a conversation between the output writer and the input reader:

DITA writer
The DITA writer knows how to generate DITA output. After producing an element, the writer requests the attributes and content of the element from the reader. For instance, the paragraph output rule generates a <p> element and then requests the id attribute and other attributes of the paragraph and then the paragraph content. Where the content is a simple sequence (for instance, as with a topic or list), the writer requests in the subelements individually.
Docbook reader
The Docbook reader knows how to read Docbook input. When the DITA writer requests an attribute or content, the reader is responsible for satisfying the request from the current input context. For instance, when the DITA paragraph writer requests an id attribute, the reader might copy the id attribute from the current Docbook input element or from a nearby Docbook input element. The reader can also generate an id attribute or skip the id attribute. Similarly, when the DITA paragraph writer requests paragraph content, the reader can provide paragraph content by invoking the output rules on any of the text and subelements from the input (often but not necessarily from content of the current input element).

This directory provides the following modules:

docbook2dita.xsl
This module combines the Docbook reader and DITA writer to transform Docbook input to DITA output.
dbReader.xsl
This module provides the base Docbook reader. The module can be extended by other modules that override the base module to handle requests from the DITA writer in different ways.