Summary

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):

DitaTopicCompare

For accessing the DITA topic comparison.

DitaMapfileCompare

For accessing the DITA map file comparison.

DitaMapTopicsetCompare

For accessing the DITA map based topic-set comparison.

DitaCompare

For 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 Class

Corresponding API Class

Command-line argument

TopicCompare.java

DitaTopicCompare

topic

MapfileCompare.java

DitaMapfileCompare

mapfile

MapTopicsetCompare.java

DitaMapTopicsetCompare (1)

mts

MapTopicsetCompareInPlace.java

DitaMapTopicsetCompare (2)

mts-inplace

GeneralCompare.java

DitaCompare

(empty)

Main.java

(none - the main JAR class)

(not-applicable)


.NET API

This sample is a .NET console application, DitaFileCompareApi.

There are four C# classes:

Sample Class

Corresponding API Class

Command-line argument

TopicCompare.cs

DitaTopicCompareDotNet

topic

MapfileCompare.cs

DitaMapfileCompareDotNet

mapfile

MapTopicsetCompare.cs

DitaMapTopicsetCompareDotNet

mts | mts-inplace

GeneralCompare.cs

DitaCompareDotNet

(empty)

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: https://bitbucket.org/deltaxml/api-sample 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.