Skip to main content
Skip table of contents

Java API Sample

Introduction

This sample is a basic demonstration of how to use DITA Merge's Java API to run some DITA Merge operations with hard-coded file paths.

Implementation

The sample is implemented in the main method of a single Java class, SimpleRunner.java, and the approach taken is as follows:

  1. Create File objects forsample inputs.

  2. Instantiate the ConcurrentMerge object using the constructor;

  3. Set the ancestor file with setAncestor;

  4. Add the demo input versions with addVersion;

  5. Call extractAll to get hold of the DeltaV2 representation of the merge.

Additionally use is made of the ThreeWayMerge class and one of its merge methods which allows merge operations to be performed using a single method call. This class also allows the approach show above but we only demonstrate the simpler method calls in the sample code.

Running

The files and instructions for this sample are available on Bitbucket.

JavaScript errors detected

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

If this problem persists, please contact our support.