How to generate documents from the command line with Ant.
startcmd.bat
Another command prompt appears with DITA-OT in the title bar, as shown in the following figure:
ant -Dargs.input=source -Dtranstype=transtype
The following table describes this command.
| Syntax | Description |
|---|---|
| ant | Starts the Ant build tool installed as part of DITA-OT. |
| -Dargs.input=source | The source specifies the DITA topic or map to process. If the build file is not in the current directory, you must specify the path to the file. |
| -Dtranstype=format | The format specifies the transformation output type to generate. |
To build XHTML output for the sample DITA map samples\hierarchy.ditamap, run the command:
ant -Dargs.input=samples\hierarchy.ditamap -Dtranstype=xhtml
DITA-OT displays a lot of output in the console window, including whether the build failed or succeeded at the end of the output.
When your build is unsuccessful, the error message may be difficult to find in the copious output. If you have not configured your console window most of the early output may have already scrolled off the screen. If you add an Ant property, -l log-file to the command line invocation, DITA-OT will save the output to a log file that you can study after the build finishes.