Migrating HTML to DITA using Ant

You can use ANT to migrate HTML files to DITA.

  1. Run either the startcmd.bat or startcmd.sh file.
  2. Change to the DITAOT\demo\h2d directory, where DITAOT is the root directory of the DITA Open Toolkit installation.
  3. Run the following command:
    ant -f build.xml [options]
    where options are the following parameters:
    -Dargs.input=input
    Specifies the location of the HTMl files to be transformed. The input variable can be either a file name or directory. The default value is the current directory.
    -Dargs.output=output
    Specifies the directory where the DITA files are written. The default value is the current directory.
    -Dargs.infotype=type
    Specifies the type of DITA file. The type variable takes the following values: concept, reference, task, or topic. The default value is topic.
    -Dargs.dita.ext=file_extension
    Specifies the extension for the generated files. The file_extension variable takes the following values: dita or xml. The default value is dita.
    -Dargs.lang=language
    Specifies the language attribute for the generated files. The language variable takes the values specified in the string.xml file located in the DITAOT\xsl\common directory, where DITAOT is the root directory of the DITA Open Toolkit installation. The default value is en-us.
    -Dargs.xsl=XSL_file
    Specifies the XSL file used by the transformation.