XML technologies / DITA / DITA Open Toolkit / Installing the programs

(Excerpt from “DITA – Der neue Standard für Technische Dokumentation” by Johannes Hentrich)

Installing the DITA Open Toolkit requires the Java Development Kit, which provides the Java environment required by the DITA Open Toolkit. See “Java Development Kit (JDK)” for instructions on installing the Java Development Kit.

After installing the Java Development Kit, the DITA Open Toolkit can be installed on Windows, Linux and MacOs.

The DITA Open Toolkit is available in the following distributions:

Besides the DITA Open Toolkit itself, the full package includes numerous other programs, including:

The small package does not include the ANT processor or Xalan as an XSLT processor. If you install the small DITA Open Toolkit package instead of the full one, you must therefore also install ANT and an XSLT processor. You can install either Xalan or Saxon as the XSLT processor. The small package is often used when an XSLT processor is already installed and the additional one supplied with the full package is not wanted. Installing ANT is described in “ANT”. “XSLT processors: Xalan, Saxon” then explains how to install the Xalan and/or Saxon XSLT processors.

The third DITA Open Toolkit package contains the source files. It offers the best opportunity to study the toolkit’s inner workings in more detail.

For the quickest and easiest installation of the DITA Open Toolkit, use the full package, which has also carried the name “easy install” since version 1.4.2. This package installs ANT and Xalan as the XSLT processor automatically. With the small package, these programs must be installed separately. “DITA Open Toolkit” shows how to install both the full and small DITA Open Toolkit packages.

Additional programs can then produce the output media. These include:

The sections Microsoft HTML Help and JavaHelp explain how to install Microsoft Help Workshop and the JavaHelp processor.

 

Java Development Kit (JDK)

The Java Development Kit is the basis for the DITA Open Toolkit and several other required programs, such as the Xalan XSLT processor included in the toolkit.

The DITA Open Toolkit requires the Java Development Toolkit (JDK), which is easily confused with the Java Runtime Environment (JRE). The toolkit’s installation instructions specify version 1.4.2_13. This version is probably no longer available online; you are more likely to find a higher sequential number such as 1.4.2_15. The preceding number 1.4.2 is what matters.

This is not the current JDK version. However, it ensures that the DITA Open Toolkit works. Those willing to experiment can also try more recent JDK versions, such as 1.6.0.

Install the JDK as follows:

  1. Download JDK 1.4.2_15 from the Internet.

  2. Install the .exe file, for example j2sdk-1_4_2_15-windows-i586-p.exe.

  3. Place the installation directory directly on your primary local drive, for example C:\j2sdk1.4.2_15.

  4. Set the JDK environment variable. Once it is set, JDK programs can be called from any directory.

Setting an environment variable can feel unfamiliar because almost every program is normally available on Windows, MacOS or Linux computers. If a program is not available, environment variables must be set. The following therefore describes how to set the environment variable on Windows computers.

Set the environment variables as follows:

  1. Choose Start -> Settings -> Control Panel.

  2. Double-click System.

  3. On the Advanced tab, click the Environment Variables button.

A dialog box like the following appears:

Windows environment variables

Figure: Windows environment variables.

  1. In the section Systemvariablen , click Neu.

  2. In the input field Name der Variablen, enter the value JAVA_HOME.

  3. In the input field Wert der Variablen, enter the value C:\j2sdk1.4.2_15. This is the JDK installation directory.

  4. In the section Systemvariablen , find the variable named PATH (case does not matter here, so the variable may also be named Path ). If there is no variable named PATH, create a new variable with this name.

  5. Double-click the entry with the variable name PATH.

  6. In the input field Wert der Variablen, enter the value %JAVA_HOME%\bin. Separate multiple values with a semicolon. Make sure there are no spaces before or after the semicolon.

  7. Confirm your entries.

You can now install the full DITA Open Toolkit package. See DITA Open Toolkit.

Installing the small DITA Open Toolkit package also requires ANT and an XSLT processor. Their installation is described in the next two sections.

 

ANT

ANT (Another Neat Tool) controls transformation of DITA XML files by the DITA Open Toolkit using build files.

Install ANT as follows:

  1. Download the current version of ANT from the Internet.

    The DITA Open Toolkit does not require a specific ANT version. At the time of writing, ANT 1.7.0 was available. For Windows, download the file apache-ant-1.7.0-bin.zip.

  2. Extract the zip file into the directory C:\ant.

  3. Set the ANT environment variables PATH, ANT_HOME and ANT_OPTS as follows:

    • Assign the environment variable PATH the value %ANT_HOME%\bin.

    • Assign the environment variable ANT_HOME the value C:\ant. This is the ANT installation directory.

    • Assign the environment variable ANT_OPTS the value -Xmx256M.

  4. Confirm your entries.

 

XSLT processors: Xalan, Saxon

An XSLT processor is needed to process the XSLT stylesheets. Either Xalan or Saxon can be used. Both work with the DITA Open Toolkit, but only one is needed. This section explains how to install each processor.

Install the Xalan XSLT processor as follows:

  1. Download the current version of Xalan from the Internet.

The latest Xalan version is 2.7.1. Version 2.7.0 is recommended for the DITA Open Toolkit, but 2.7.1 can also be used without difficulty.

Make sure you download a binary version of Xalan. You can recognize it by the letters bin in its filename, as in this Windows binary: xalan-j_2_7_0-bin.zip.

  1. Extract the zip file into the directory C:\xalan.

  2. Set the Xalan environment variable CLASSPATH.

In the section Systemvariablen, find the variable named CLASSPATH. If there is no variable named CLASSPATH, create a new variable with this name.

  1. Double-click the entry with the variable name CLASSPATH.

  2. In the input field Wert der Variablen, enter the value C:\xalan\bin.

Here, C:\xalan is the Xalan installation directory. Separate multiple values with a semicolon. Make sure there are no spaces before or after the semicolon.

  1. Confirm your entries.

If you prefer the XSLT processor Saxon, install it as follows:

  1. Download version 6.5.5 of the XSLT processor Saxon from the Internet.

Saxon now has a version 8.9. In practice, however, difficulties repeatedly arise when processing the DITA XSLT stylesheets.

  1. Extract the zip file into the directory C:\saxon.

  2. Set the Saxon environment variable CLASSPATH.

In the section Systemvariablen , find the variable named CLASSPATH. If there is no variable named CLASSPATH, create a new variable with this name.

  1. Double-click the entry with the variable name CLASSPATH.

  2. In the input field Wert der Variablen, enter the value C:\saxon\saxon.jar .

Here, C:\saxon is the Xalan installation directory. Separate multiple values with a semicolon. Make sure there are no spaces before or after the semicolon.

  1. Assign the environment variable ANT_OPTS the value -Djavax.xml.transform.TransformerFactory=com.icl.saxon.TransformerFactoryImpl.

  2. Confirm your entries.

 

DITA Open Toolkit

This section explains how to install the full and small DITA Open Toolkit packages. Unlike the full package, the small package also requires ANT and an XSLT processor to be installed. Both programs are already included in the full package.

Install the full DITA Open Toolkit package as follows:

  1. Download the full DITA Open Toolkit package from the Internet.

The full DITA Open Toolkit 1.4 package requires the file DITA-OT1.4.2.1_full_easy_install_bin.zip.

  1. Extract the zip file, for example into the directory C:\ditaot14.

Installation of the full DITA Open Toolkit package is already complete!

The full package needs several environment variables. You need not set them manually if you use the batch file startcmd.bat located in the toolkit’s root directory. This startcmd.bat file sets the environment variables for:

  • ANT

  • XML catalog resolver

  • Apache FOP version 0.20.5

  • Xalan

  • and several other Java programs

The startcmd.bat file also opens the command line.

Calling the startcmd.bat file

Figure: Calling the startcmd.bat file.

If you use the DITA Open Toolkit frequently, create a shortcut to the startcmd.bat file and place it on the desktop.

Double-clicking the shortcut opens the command line, allowing you to start working with the DITA Open Toolkit immediately.

The small DITA Open Toolkit package does not include the ANT processor or Xalan as the XSLT processor. For ANT installation instructions, see ANT. For instructions on installing Xalan, see XSLT processors: Xalan, Saxon.

The recommended installation order for the small package is:

  • ANT processor

  • Xalan

  • small DITA Open Toolkit package

Unlike the full package, the small package has no batch file for setting environment variables automatically. Installation therefore also requires environment variable configuration.

Install the small DITA Open Toolkit package as follows:

  1. Download the small package from the Internet.

The small DITA Open Toolkit 1.4 package requires the file DITA-OT1.4.2.1_minimal_bin.zip.

  1. Extract the zip file, for example into the directory C:\ditaot14.

  2. Add the following paths to the environment variable CLASSPATH:

C:\ditaot14\lib;
C:\ditaot14\lib\dost.jar;
C:\ditaot14\lib\resolver.jar;

Make sure there are no spaces before or after the semicolon!

Installation of the small DITA Open Toolkit package is now also complete.

You can easily test whether installation of either the full or small package succeeded.

For the full package, first run the startcmd.bat file to open the command line.

For the small package, open the command line in Windows by choosing Start -> Run and entering cmd . Then change to the toolkit’s root directory, in this case C:\ditaot14.

Test by calling the build_demo.xml ANT build file:

ant all -f build_demo.xml

For a detailed description of ANT and ANT build files, see ANT. Here, calling the ANT build file processes the contents of the directories demo and samples .

Processing can take several minutes depending on processor speed and then displays the following result:

Successful DITA Open Toolkit installation

Figure: Successful DITA Open Toolkit installation.

If the sample files are processed successfully, that is, after successful installation of the toolkit, an out directory is created containing the output media of the processed DITA XML files.

Errors during the test processing of DITA XML files are often caused by incorrectly set environment variables. For example, the error message

Can‘t find resource\messages.xml

is caused by incorrectly set environment variables for the dost.jar file. The error message

NoClassDefFoundError

also indicates that the CLASSPATH environment variables were not set correctly.

 

Microsoft HTML Help

Microsoft HTML Help Workshop 1.4 can create Microsoft HTML Help from the generated HTML files.

Install Microsoft HTML Help Workshop as follows:

  1. Download Microsoft HTML Help Workshop from the Internet.

  2. Double-click the file htmlhelp.exe and follow the on-screen installation instructions.

    The toolkit’s ANT build file build_init.xml assumes that Microsoft HTML Help Workshop is installed in the following directory: C:\Program Files\HTML Help Workshop

  3. In the build_init.xml file, change the Microsoft Help Workshop path in the following <property> element to match your installation:

<property name="hhc.dir" value="C:\Program Files\HTML Help Workshop"/>

Microsoft Help Workshop can now be used with the DITA Open Toolkit.

 

JavaHelp

The JavaHelp processor can create JavaHelp.

Install the JavaHelp processor as follows:

  1. Download the JavaHelp processor from the Internet.

    The current JavaHelp processor version is JavaHelp 2.0_05.

  2. Extract the zip file onto drive C:\. The directory C:\jh2.0 is created.

  3. Set the environment variable JHHOME to the installation directory value, that is, C:\jh2.0.

Setting the environment variable allows the DITA Open Toolkit to find the JavaHelp processor.

  

 

 

 

back to top