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:
Full package (full easy install package distribution)
Small package (small package distribution)
Source files (source distribution)
Besides the DITA Open Toolkit itself, the full package includes numerous other programs, including:
ANT processor
XML catalog resolver
FOP processor
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:
Microsoft HTML Help Workshop
JavaHelp processor
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:
Download JDK 1.4.2_15 from the Internet.
Install the .exe file, for example
j2sdk-1_4_2_15-windows-i586-p.exe.Place the installation directory directly on your primary local drive, for example
C:\j2sdk1.4.2_15.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:
Choose Start -> Settings -> Control Panel.
Double-click System.
On the Advanced tab, click the Environment Variables button.
A dialog box like the following appears:
Figure: Windows environment variables.
In the section
Systemvariablen, clickNeu.In the input field
Name der Variablen, enter the valueJAVA_HOME.In the input field
Wert der Variablen, enter the valueC:\j2sdk1.4.2_15. This is the JDK installation directory.In the section
Systemvariablen, find the variable namedPATH(case does not matter here, so the variable may also be namedPath). If there is no variable namedPATH, create a new variable with this name.Double-click the entry with the variable name
PATH.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.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:
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.Extract the zip file into the directory
C:\ant.Set the ANT environment variables
PATH,ANT_HOMEandANT_OPTSas follows:Assign the environment variable
PATHthe value%ANT_HOME%\bin.Assign the environment variable
ANT_HOMEthe valueC:\ant. This is the ANT installation directory.Assign the environment variable
ANT_OPTSthe value-Xmx256M.
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:
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
binin its filename, as in this Windows binary:xalan-j_2_7_0-bin.zip.
Extract the zip file into the directory
C:\xalan.Set the Xalan environment variable
CLASSPATH.
In the section
Systemvariablen, find the variable namedCLASSPATH. If there is no variable namedCLASSPATH, create a new variable with this name.
Double-click the entry with the variable name
CLASSPATH.In the input field
Wert der Variablen, enter the valueC:\xalan\bin.
Here,
C:\xalanis the Xalan installation directory. Separate multiple values with a semicolon. Make sure there are no spaces before or after the semicolon.
Confirm your entries.
If you prefer the XSLT processor Saxon, install it as follows:
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.
Extract the zip file into the directory
C:\saxon.Set the Saxon environment variable
CLASSPATH.
In the section
Systemvariablen, find the variable namedCLASSPATH. If there is no variable namedCLASSPATH, create a new variable with this name.
Double-click the entry with the variable name
CLASSPATH.In the input field
Wert der Variablen, enter the valueC:\saxon\saxon.jar.
Here,
C:\saxonis the Xalan installation directory. Separate multiple values with a semicolon. Make sure there are no spaces before or after the semicolon.
Assign the environment variable
ANT_OPTSthe value-Djavax.xml.transform.TransformerFactory=com.icl.saxon.TransformerFactoryImpl.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:
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.
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.
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:
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.
Extract the zip file, for example into the directory
C:\ditaot14.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.xmlFor 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:
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:
Download Microsoft HTML Help Workshop from the Internet.
Double-click the file
htmlhelp.exeand follow the on-screen installation instructions.The toolkit’s ANT build file
build_init.xmlassumes that Microsoft HTML Help Workshop is installed in the following directory:C:\Program Files\HTML Help WorkshopIn the
build_init.xmlfile, 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:
Download the JavaHelp processor from the Internet.
The current JavaHelp processor version is JavaHelp 2.0_05.
Extract the zip file onto drive
C:\. The directoryC:\jh2.0is created.Set the environment variable
JHHOMEto the installation directory value, that is,C:\jh2.0.
Setting the environment variable allows the DITA Open Toolkit to find the JavaHelp processor.
Copyright © 2008 XLcontent Verlag
You may print the online version for your private use.
Otherwise, this chapter from “DITA - Der neue Standard für Technische Dokumentation” is subject to the same conditions as the bound edition. The work, including all its parts, is protected by copyright. All rights reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
XLcontent Verlag, Pflegerstraße 40, 81247 München
