The structure of the script is:
A simple XML header
<?xml version="1.0"?>
A project, which contains:
A description that tells what the script does
<description> This Ant build.xml file is used to transform DocBook XML 1. xml to epub input/epub -> output/epub 2. xml to fo to PDF input/pdf -> ouput/pdf 3. xml to webhelp input/webhelp -> output/webhelp </description>
A number of properties that set variables with the input, output and utilities locations
<!-- inputs --> <property name="epubbook" value="test"/> <property name="pdfbook" value="test"/> <property name="webhelpbook" value="test"/> <property name="epubinput.dir" value="input/epub"/> <property name="epubimg.dir" value="${epubinput.dir}/images"/> <property name="epubinput" value="${epubbook}"/> etc ...
A number of path and classpath that prepare the execution of the utilities
<path id="xalan.classpath"> <fileset dir="${xalan.lib.dir}" id="xalan.fileset"> <include name="xalan-2.7.0.jar"/> <include name="xercesImpl-2.7.1.jar"/> </fileset> </path> etc ...
A target 'All' that triggers the execution of the other targets
<target name="all" description="Execute all the targets in my ant file" depends="xml-epub,xml-fo-PDF,xml-webhelp"/>
A target for the transformation to the epub format
<target name="xml-epub" description="Transform xml into epub"> <echo message="Generate the epub file"/> etc ...
A target for the transformation to the pdf format
<target name="xml-fo-PDF" description="Transform xml into fo then into PDF"> <echo message="Generating the PDF file."/> etc ...
A target for the transformation to the webhelp format
<target name="xml-webhelp" description="transform XML into a weblhelp app"> etc ...
Each target is subdivided into a number of actions that depend on the transformation being performed. Common actions are:
Delete the current output folder contents
Copy additional elements such as pictures
Perform the requested transformation