Topicset Book Map Sample

Summary

Note that any DITA map specialisation should be handled in a similar manner to the Book Map specialisation, as the implementation works off the class attributes of the elements to determine whether a topic reference has been found. A current limitation is that the attribute names cannot be specialised.

Script Features

This sample script (Ant or batch file - depending on download) compares two DITA Book Maps, book1/main.ditamap and book2/main.ditamap, using the 'topic set', 'map pair' and 'unified map' map result structures. Please refer to Map LeveL Output Formats Section of the Reference and the map-result-structure parameter documentation for more details on these result structures.

Result Origin

The 'result origin' is the input map that is used to form the basis of the output, as discussed in Map LeveL Output Formats Section of the Reference and the map-result-origin parameter documentation.

Output Structure and Destination

The output of the 'topic set', 'map pair' and 'unified-map' comparisons are put into the topic-set-A, map-pair-B and unified-map-B directories respectively. These directories contain a result-alias.ditamap file whose content references the actual results, but can be used as a result in its own right. Note that in the case of the map pair result, the alias combines the two main result maps into a single document.

Java Platform

Using Ant

The sample comparison can be run via an build script using the following commands.

antRun all comparisons.
ant run
ant run-topic-set-ARun the 'topic set' comparison (where the first 'A' input is being used as the 'result origin').
ant run-map-pair-BRun the 'map pair' comparison (where the second 'B' input is being used as the 'result origin').
ant run-unified-map-BRun the 'unified map' comparison (where the second 'B' input is being used as the 'result origin').
ant cleanRemove the generate output.

From the Command-Line

The 'topic-set' sample can be run directly by issuing the following command

For Windows

java -jar ..\..\deltaxml-dita.jar compare map book1\main.ditamap book2\main.ditamap topic-set-A ^
  map-result-origin=A ^
  map-result-structure=topic-set

PowerShell Usage: Replace the ^ line-continuation character with the ` character.

For Mac OS (or Unix)

java -jar ../../deltaxml-dita.jar compare map book1/main.ditamap book2/main.ditamap topic-set-A \
  map-result-origin=A \
  map-result-structure=topic-set

The 'map pair' or 'unified map' comparison can be run in a similar manner to the 'topic set', but in this case the map-result-orign is B, the map-result-structure is map-pair or unified map, and the map-copy-location is map-pair-B or unified-map-B.

.NET Platform

Using a Batch File

Run the rundemo.bat batch file either by entering rundemo from the command-line or by double-clicking on this file from Windows Explorer. This script runs the comparison twice, once for a 'topic-set' and once for a 'unified map'.

From the Command-Line

The sample comparison can also be run from the command line, for example, the 'topic-set' comparison is performed using the following:

..\..\bin\deltaxml-dita.exe compare map book1/main.ditamap book2/main.ditamap topic-set-A ^
  map-result-origin=A ^
  map-result-structure=topic-set

The 'map pair' or 'unified map' comparison can be run in a similar manner to the 'topic set', but in this case the map-result-origin is B, the map-result-structure is map-pair or unified-map, and the map-copy-location is map-pair-B or unified-map-B.