<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept id="runant" xml:lang="en">
  <title>Running Ant</title>
  <shortdesc>After setting up the Ant environment, you can build the DITA output by running the
      <codeph>ant</codeph> command. </shortdesc>
  <conbody>
    <p>Here are some samples to explain how to use Ant to build sample output in the DITA
    directory. </p><note>To run the Ant demo properly, you should switch to the <b>DITA-OT installation
      directory</b> under the command prompt. If you are using the "Full Easy Install" package,
      running the <filepath>startcmd.bat</filepath> batch file in that directory will give you a
      prompt that is already set up for the following commands.</note>
    <example>
      <p>To build XHTML output for the sample DITA map
          <filepath>samples/hierarchy.ditamap</filepath>, run the command: </p>
      <codeblock>ant -Dargs.input=samples/hierarchy.ditamap -Doutput.dir=out/samples/web -Dtranstype=xhtml </codeblock>
      <p>This will generate the output into <filepath>out/samples/web</filepath> directory. The
        samples directory also contains dedicated Ant build files for various transformation types
        and the same output can be generated with the <filepath>sample_xhtml.xml</filepath>: </p>
      <codeblock>ant -f samples/ant_sample/sample_xhtml.xml</codeblock>
      <p>You can build all samples in the DITA directory:</p>
      <codeblock>ant -f build_demo.xml all</codeblock>
      <p>The building process will create an <filepath>/out/</filepath> directory and put the output
        files in subdirectories that parallel the source directory. </p>
      <note>To find out the complete list of targets you can clean and build, check the
          <codeph>name</codeph> attributes for the target elements within the
          <filepath>build_demo.xml</filepath> file. Or, input <codeph>ant -f build_demo.xml
          -projecthelp</codeph> for a full list information.</note>
    </example>
        <example>You can also build your own selections using a prompted build.
            <codeblock>ant -f build_demo.xml</codeblock><p>Ant will prompt you for the input file,
            output directory, and transform type. Values on these parameters are case
          sensitive.</p></example>
    <section><note>To troubleshoot problems in setting up Java, Ant, Saxon,
        or FOP, you will get better information from the communities for those components rather
        than the communities for the DITA. Of course, if you find issues relevant to the DITA XSLT
        scripts (or have ideas for improving them), you are encouraged to engage the DITA
        community.</note>
    </section>
  </conbody>
  <related-links>
    <link href="DITA-antscript.xml">
      <linktext>Writing reusable Ant builds</linktext>
    </link>
  </related-links>
</concept>
