Skip to main content
Skip table of contents

API Sample


This sample illustrates how the API (Application Programming Interface) can be used to run the DITA Comparison.

Depending on which product you have downloaded the sample directories will contain content for either the Java or .NET platforms (e.g. Java or C# source code). This documentation will discuss both APIs.

In both platforms there are four main API classes for accessing the comparison (.NET classes hava an additional 'DotNet' suffix):

DitaTopicCompareFor accessing the DITA topic comparison.
DitaMapfileCompareFor accessing the DITA map file comparison.
DitaMapTopicsetCompareFor accessing the DITA map based topic-set comparison.
DitaCompareFor accessing the map-file, map-topicset and topic comparisons, through a simplified interface.

Command-line Arguments

The samples for each platform support the use of a command-line argument from the entry-point class to control which DITA Compare API classes are used. The arguments used are included in the sample summary tables.

Java API

There are 5 Java classes in the Java API sample:

Sample ClassCorresponding API ClassCommand-line argument
MapTopicsetCompare.javaDitaMapTopicsetCompare (1)mts
MapTopicsetCompareInPlace.javaDitaMapTopicsetCompare (2)mts-inplace
GeneralCompare.javaDitaCompare(empty) - the main JAR class)(not-applicable)


This sample is a .NET console application, DitaFileCompareApi.

There are four C# classes:

Sample ClassCorresponding API ClassCommand-line argument
MapTopicsetCompare.csDitaMapTopicsetCompareDotNetmts | mts-inplace
Program.cs(none - the startup class)(not-applicable)

Running the sample

The sample resources and a description on how to run it can be found at: for Java and here for .NET.

The resources should be checked-out, cloned or downloaded and unzipped into the samples directory of the DITA Compare release. They should be located such that they are two levels below the top level release directory, for example DeltaXML-DITA-Compare-8_0_0_j/samples/api-sample.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.