Comparing DocBook Documents

Comparing DocBook Documents

Prerequisites

  • DeltaNova installed and licensed with DocBook capability.

  • Both input files are the same DocBook type (both book, or both article, etc.).

Basic Comparison

CLI:

Bash
java -jar deltanova-year.x.y.z.jar compare docbook input1.xml input2.xml result.xml config.xml[optional]

Java API:

Java
import com.deltaxml.docbook.DocBookCompare;

DocBookCompare dbc = new DocBookCompare();
dbc.compare(new File("docA.xml"), new File("docB.xml"), new File("result.xml"));

The output is a DocBook file with revisionflag attributes marking changes.

Selecting an Output Format

Set the output-format parameter in the configuration file to use an editor-specific tracked change format:

Bash
<?xml version="1.0" encoding="UTF-8"?>
<configuration xmlns="com.deltaxml.docbook.rest.config"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:noNamespaceSchemaLocation="docbook-configuration.xsd">
  <parameters>
    <outputParameters>
      <outputFormat>oxygen-tc</outputFormat>
      <trackedChanges>
        <trackedChangesAuthor>deltaxml</trackedChangesAuthor>
        <trackedChangesDate>xsl date</trackedChangesDate>
        <oxygenTcsDeletedSpaceMode>automatic</oxygenTcsDeletedSpaceMode>
        <oxygenTcsVersion>11.2</oxygenTcsVersion>
        <xmetalTcsTableChangeMode>down</xmetalTcsTableChangeMode>
        <framemakerTcsTableChangeMode>down</framemakerTcsTableChangeMode>
      </trackedChanges>
    </outputParameters>
  </parameters>
</configuration>

Available values: docbook-markup (default), arbortext-tc, framemaker-tc, oxygen-tc,
xmetal-tc.

Viewing the Comparison Result

DocBook Markup output can be processed with your existing DocBook XSL stylesheets. Customise the stylesheets to render revisionflag="added" content in green and revisionflag="deleted"content in red with strikethrough.

Tracked change formats are opened directly in the target editor (oXygen, FrameMaker, Arbortext, XMetaL) where changes can be reviewed and accepted or rejected using the editor's standard change-tracking UI.

Publishing Comparison Results

DocBook Comparison output can be published to HTML or XSL-FO/PDF using DocBook XSL stylesheets.
The distribution includes a DocBook XSL customisation that adds change bars to XSL-FO output and colour-highlights changes in HTML output.

See How to Compare DocBook for the full publishing walkthrough.