<project name="dita-targets"  basedir=".">
<!-- This file is part of the DITA Open Toolkit project hosted on 
     Sourceforge.net. See the accompanying license.txt file for 
     applicable licenses.-->
<!-- (c) Copyright IBM Corp. 2004, 2006 All Rights Reserved. -->
<!-- Deprecated: left for backward compatibility, and it will be removed in a 
     later release -->
    
<!-- parameters   
	args.input          required
	dita.temp.dir       required
	dita.script.dir     required
  dita.ext            required
  output.dir          required
-->
  
<target name="dita.init">
  <!-- environment -->  
</target>

<!-- Build DocBook output from ditamap -->
<target name="dita.map.docbook" description="Build DocBook output from ditamap">  
  <condition property="args.xsl" value="${dita.script.dir}${file.separator}map2docbook.xsl">
    <not>
      <isset property="args.xsl"/>
    </not>
  </condition>
  <mkdir dir="${outputDir}" />
  <xslt processor="trax"
        in="${inputDir}${file.separator}${inputMap}"
        out="${outputDir}${file.separator}${mapRoot}.xml"
        style="${args.xsl}">
    <param name="outputdir" expression="${outputDir}" />
    <!--<xmlcatalog refid="dita.catalog" />-->
  </xslt>
</target>

<!-- Build DocBook output from dita topic -->
<target name="dita.topic.docbook" description="Build DocBook output from dita topic">
  <condition property="args.xsl" value="${dita.script.dir}${file.separator}dita2docbook.xsl">
    <not>
      <isset property="args.xsl"/>
    </not>
  </condition>
  <xslt processor="trax"
        in="${inputFile}"
        out="${outputFile}"
        style="${args.xsl}">
    <!--<xmlcatalog refid="dita.catalog" />-->
  </xslt>
</target>

<!-- Build RTF from DITA -->
<target name="dita.topic.rtf">
  <condition property="args.xsl" value="${dita.script.dir}${file.separator}dita2rtf.xsl">
    <not>
      <isset property="args.xsl"/>
    </not>
  </condition>
  <dirname file="${output}" property="dita.rtf.outputdir"/>
  <xslt processor="trax"
        in="${input}"
        out="${output}"
        style="${args.xsl}">    
    <param name="DRAFT" expression="${args.draft}" if="args.draft"/>
    <param name="OUTPUTDIR" expression="${dita.rtf.outputdir}"/>
    <!--<xmlcatalog refid="dita.catalog" />-->
  </xslt>
</target>

<target name="dita.map.rtf">
  <condition property="args.xsl" value="${dita.script.dir}${file.separator}dita2rtf.xsl">
    <not>
      <isset property="args.xsl"/>
    </not>
  </condition>
  <dirname file="${output}" property="dita.rtf.outputdir"/>
  <xslt processor="trax"
	    in="${input}"
	    out="${dita.temp.dir}${file.separator}${dita.map.filename.root}_MERGED.xml"
        style="${dita.script.dir}${file.separator}topicmerge.xsl">
    <!--<xmlcatalog refid="dita.catalog" />-->
  </xslt>
  <xslt processor="trax"
	    in="${dita.temp.dir}${file.separator}${dita.map.filename.root}_MERGED.xml"
		out="${output}"
        style="${args.xsl}">
    <param name="DRAFT" expression="${args.draft}" if="args.draft"/>
    <param name="OUTPUTDIR" expression="${dita.rtf.outputdir}"/>
    <!--<xmlcatalog refid="dita.catalog" />-->
  </xslt>
</target>

<!-- Build XSL-FO output from ditamap -->
<target name="dita.map.fo" description="Build XSL-FO output from ditamap">
  <condition property="args.xsl" value="${dita.script.dir}${file.separator}dita2fo-shell.xsl">
    <not>
      <isset property="args.xsl"/>
    </not>
  </condition>
  <dirname file="${dita.temp.dir}${file.separator}${user.input.file}" property="dita.merged.dir"/>
  <xslt processor="trax"
	    in="${input}"
	    out="${dita.merged.dir}${file.separator}${dita.map.filename.root}_MERGED.xml"
        style="${dita.script.dir}${file.separator}topicmerge.xsl">
    <!--<xmlcatalog refid="dita.catalog" />-->
  </xslt>
  <xslt processor="trax"
	    in="${dita.merged.dir}${file.separator}${dita.map.filename.root}_MERGED.xml"
      out="${output}"
      style="${args.xsl}">
    <!--<xmlcatalog refid="dita.catalog" />-->
    <param name="output-related-links" expression="${args.fo.output.rel.links}" if="args.fo.output.rel.links"/>
    <param name="DITAEXT" expression="${dita.ext}" if="dita.ext"/>
    <param name="DRAFT" expression="${args.draft}" if="args.draft"/>
    <param name="ARTLBL" expression="${args.artlbl}" if="args.artlbl"/>
    <param name="dflt-ext" expression="${fo.img.ext}" if="fo.img.ext"/>
  </xslt>
</target>

<!-- Build PDF from FO using FOP, need to include FOP, Avalon, 
	 and Batik relevant jar files in CLASSPATH -->
<target name="dita.fo2pdf" if="hasFOP" description="Build PDF from FO using FOP">
  <taskdef name="fop" classname="org.apache.fop.tools.anttasks.Fop"/>
  <antcall target="dita.fo2pdf.userconfig"/>
  <antcall target="dita.fo2pdf.nouserconfig"/>    
</target>
    
<target name="dita.fo2pdf.userconfig" if="args.fo.userconfig">
  <fop format="application/pdf"
       basedir="${input}"
       fofile="${input}"
       outfile="${output}"
       messagelevel="info"
       userconfig="${args.fo.userconfig}">
  </fop>
</target>
    
<target name="dita.fo2pdf.nouserconfig" unless="args.fo.userconfig">
  <fop format="application/pdf"
	   basedir="${input}"
       fofile="${input}"
       outfile="${output}"
       messagelevel="info">
  </fop>
</target>

<!-- Build XSL-FO output from dita topic -->
<target name="dita.topic.fo" description="Build XSL-FO output from dita topic">
  <condition property="args.xsl" value="${dita.script.dir}${file.separator}dita2fo-shell.xsl">
    <not>
      <isset property="args.xsl"/>
    </not>
  </condition>
  <xslt processor="trax"
        in="${input}"
        out="${output}"
        style="${args.xsl}">
    <!--<xmlcatalog refid="dita.catalog" />-->
    <param name="output-related-links" expression="${args.fo.output.rel.links}" if="args.fo.output.rel.links"/>
    <param name="DITAEXT" expression="${dita.ext}" if="dita.ext"/>
    <param name="DRAFT" expression="${args.draft}" if="args.draft"/>
    <param name="ARTLBL" expression="${args.artlbl}" if="args.artlbl"/>	
    <param name="dflt-ext" expression="${fo.img.ext}" if="fo.img.ext"/>
  </xslt>
</target>

<!-- xhtml output -->
<target name="dita.topics.xhtml" description="Build XHTML output from dita topics" depends="copy-revflag">
  <condition property="out.ext" value=".html">
    <not>
      <isset property="out.ext"/>
    </not>
  </condition>
  <condition property="args.xsl" value="${dita.script.dir}${file.separator}dita2xhtml.xsl">
    <not>
      <isset property="args.xsl"/>
    </not>
  </condition>
  <xslt processor="trax"
		basedir="${dita.temp.dir}"
		destdir="${output.dir}"
        includesfile="${dita.temp.dir}${file.separator}${fullditatopicfile}"
		extension="${out.ext}"
		style="${args.xsl}">
  	    <excludesfile name="${dita.temp.dir}${file.separator}${resourceonlyfile}" if="resourceonlyfile"/>
        <param name="DITAEXT" expression="${dita.ext}" if="dita.ext"/>
        <param name="FILTERFILE" expression="${dita.input.valfile}" if="dita.input.valfile"/>
        <param name="CSS" expression="${args.css.file}" if="args.css.file"/>
        <param name="CSSPATH" expression="${user.csspath}" if="user.csspath"/>
        <param name="HDF" expression="${args.hdf}" if="args.hdf"/>
        <param name="HDR" expression="${args.hdr}" if="args.hdr"/>
        <param name="FTR" expression="${args.ftr}" if="args.ftr"/>
        <param name="DRAFT" expression="${args.draft}" if="args.draft"/>
        <param name="ARTLBL" expression="${args.artlbl}" if="args.artlbl"/>
        <param name="INDEXSHOW" expression="${args.indexshow}" if="args.indexshow"/>
        <param name="OUTEXT" expression="${out.ext}" if="out.ext"/>
    </xslt>
  <antcall target="copy-css"/>
</target>

  <target name="copy-revflag" if="dita.input.valfile">
    <copy todir="${output.dir}">
      <fileset dir="${dita.resource.dir}" includes="*.gif"/>
    </copy>
  </target>

<target name="dita.map.xhtml" description="Build HTML TOC file from ditamap">
  <condition property="out.ext" value=".html">
    <not>
      <isset property="out.ext"/>
    </not>
  </condition>
  <condition property="args.xhtml.toc" value="index">
    <not>
      <isset property="args.xhtml.toc"/>
    </not>
  </condition>
  <condition property="args.xhtml.contenttarget" value="contentwin">
    <not>
      <isset property="args.xhtml.contenttarget"/>
    </not>
  </condition>
  <xslt processor="trax"
		basedir="${dita.temp.dir}"
		destdir="${output.dir}"
        includesfile="${dita.temp.dir}${file.separator}${user.input.file.listfile}"
		style="${dita.script.dir}${file.separator}map2htmtoc.xsl">
  	    <excludesfile name="${dita.temp.dir}${file.separator}${resourceonlyfile}" if="resourceonlyfile"/>
        <param name="DITAEXT" expression="${dita.ext}" if="dita.ext"/>
        <param name="OUTEXT" expression="${out.ext}" if="out.ext"/>
        <param name="CSS" expression="${args.css.file}" if="args.css.file"/>
        <param name="CSSPATH" expression="${user.csspath}" if="user.csspath"/>
        <param name="contenttarget" expression="${args.xhtml.contenttarget}" if="args.xhtml.contenttarget"/>
        <param name="OUTPUTCLASS" expression="${args.xhtml.toc.class}" if="args.xhtml.toc.class"/>
        <mapper type="glob" from="*${dita.input.filename}" to="*${args.xhtml.toc}${out.ext}"/>
    </xslt>
</target>
<!-- end xhtml process -->

<!-- eclipse output -->
<target name="dita.map.eclipse" description="Build EclipseHelp TOC and plugin.xml from ditamap">
  <basename property="dita.map.toc.root" file="${dita.input.filename}" suffix=".ditamap"/>
  <condition property="args.eclipsehelp.toc" value="${dita.map.toc.root}">
    <not>
      <isset property="args.eclipsehelp.toc"/>
    </not>
  </condition>
  <condition property="out.ext" value=".html">
    <not>
      <isset property="out.ext"/>
    </not>
  </condition>
  <condition property="noPlugin">
    <equals arg1="${dita.eclipse.plugin}" arg2="no"/>
  </condition>
  <xslt processor="trax"
    basedir="${dita.temp.dir}"
		destdir="${output.dir}"
    includesfile="${dita.temp.dir}${file.separator}${fullditamapfile}"
    extension=".xml"
		style="${dita.script.dir}${file.separator}map2eclipse.xsl">
  	    <excludesfile name="${dita.temp.dir}${file.separator}${resourceonlyfile}" if="resourceonlyfile"/>
        <param name="DITAEXT" expression="${dita.ext}" if="dita.ext"/>
        <param name="OUTEXT" expression="${out.ext}" if="out.ext"/>
    </xslt>    
  <antcall target="dita.map.plugin"/>
</target>

  <target name="dita.map.plugin" unless="noPlugin">
    <xslt processor="trax"
      in="${dita.temp.dir}${file.separator}${user.input.file}"
      out="${dita.map.output.dir}${file.separator}plugin.xml"
      style="${dita.script.dir}${file.separator}map2plugin.xsl">
      <param name="TOCROOT" expression="${args.eclipsehelp.toc}"/>
      <param name="version" expression="${args.eclipse.version}" if="args.eclipse.version"/>
      <param name="provider" expression="${args.eclipse.provider}" if="args.eclipse.provider"/>
    </xslt>
  </target>

<target name="dita.topics.eclipse">
  <antcall target="dita.topics.xhtml"/>
</target>
<!-- end eclipse process -->

<!-- eclipse content provider -->
<target name="dita.map.eclipse.content" description="Build EclipseContent TOC and plugin.xml from ditamap">
  <basename property="dita.map.toc.root" file="${dita.input.filename}" suffix=".ditamap"/>
  <condition property="args.eclipsecontent.toc" value="${dita.map.toc.root}">
    <not>
      <isset property="args.eclipsecontent.toc"/>
    </not>
  </condition>
  <condition property="content.link.ext" value=".html?srcext=dita">
	<equals arg1="${dita.ext}" arg2=".dita"></equals>
  </condition>
  <condition property="content.link.ext" value=".html?srcext=xml">
	<equals arg1="${dita.ext}" arg2=".xml"></equals>
  </condition>
  <xslt processor="trax"
    basedir="${dita.temp.dir}"
		destdir="${output.dir}"
        includesfile="${dita.temp.dir}${file.separator}${user.input.file.listfile}"
		style="${dita.script.dir}${file.separator}map2eclipse.xsl">
  	    <excludesfile name="${dita.temp.dir}${file.separator}${resourceonlyfile}" if="resourceonlyfile"/>
        <param name="DITAEXT" expression="${dita.ext}" if="dita.ext"/>
        <param name="OUTEXT" expression="${content.link.ext}"/>
        <mapper type="glob" from="*${dita.input.filename}" to="*${args.eclipsecontent.toc}.xml"/>
    </xslt>
    <xslt processor="trax"
      in="${dita.temp.dir}${file.separator}${user.input.file}"
      out="${dita.map.output.dir}${file.separator}plugin.xml"
      style="${dita.script.dir}${file.separator}map2plugin-cp.xsl">
        <param name="TOCROOT" expression="${args.eclipsecontent.toc}"/>
        <param name="version" expression="${args.eclipse.version}" if="args.eclipse.version"/>
        <param name="provider" expression="${args.eclipse.provider}" if="args.eclipse.provider"/>
    </xslt>
</target>

<target name="dita.topics.eclipse.content">
  <copy todir="${output.dir}">
    <fileset dir="${dita.temp.dir}" includes="${fullditatopiclist}">      
    </fileset>
  </copy>
</target>
<!-- end eclipse content provider process -->

<!-- java help output -->
<target name="dita.map.javahelp" description="Build JavaHelp TOC, Map, Helpset, Index files">
  <basename property="dita.map.toc.root" file="${dita.input.filename}" suffix=".ditamap"/>
  <condition property="args.javahelp.toc" value="${dita.map.toc.root}">
    <not>
      <isset property="args.javahelp.toc"/>
    </not>
  </condition>
  <condition property="args.javahelp.map" value="${dita.map.toc.root}">
    <not>
      <isset property="args.javahelp.map"/>
    </not>
  </condition>
  <condition property="out.ext" value=".html">
    <not>
      <isset property="out.ext"/>
    </not>
  </condition>
  <xslt processor="trax"
    basedir="${dita.temp.dir}"
		destdir="${output.dir}"
        includesfile="${dita.temp.dir}${file.separator}${user.input.file.listfile}"
		style="${dita.script.dir}${file.separator}map2javahelptoc.xsl">
  	    <excludesfile name="${dita.temp.dir}${file.separator}${resourceonlyfile}" if="resourceonlyfile"/>
        <param name="DITAEXT" expression="${dita.ext}" if="dita.ext"/>
        <param name="OUTEXT" expression="${out.ext}" if="out.ext"/>
        <mapper type="glob" from="*${dita.input.filename}" to="*${args.javahelp.toc}.xml"/>
    </xslt>
  <xslt processor="trax"
    basedir="${dita.temp.dir}"
		destdir="${output.dir}"
        includesfile="${dita.temp.dir}${file.separator}${user.input.file.listfile}"
		style="${dita.script.dir}${file.separator}map2javahelpmap.xsl">
  	    <excludesfile name="${dita.temp.dir}${file.separator}${resourceonlyfile}" if="resourceonlyfile"/>
        <param name="DITAEXT" expression="${dita.ext}" if="dita.ext"/>
        <param name="OUTEXT" expression="${out.ext}" if="out.ext"/>      
        <mapper type="glob" from="*${dita.input.filename}" to="*${args.javahelp.map}.jhm"/>
    </xslt>
	
	<!-- Generate Java Help Set File -->
	<xslt processor="trax"
	      basedir="${dita.temp.dir}"
	      destdir="${output.dir}"
	      includesfile="${dita.temp.dir}${file.separator}${user.input.file.listfile}"
	      style="${dita.script.dir}${file.separator}map2javahelpset.xsl">
		    <excludesfile name="${dita.temp.dir}${file.separator}${resourceonlyfile}" if="resourceonlyfile"/>
	        <param name="javahelpmap" expression="${args.javahelp.map}"/>
            <param name="javahelptoc" expression="${args.javahelp.toc}"/>
            <mapper type="glob" from="*${dita.input.filename}" to="*${dita.map.toc.root}_helpset.hs"/>
    </xslt>
    
	<!-- Generate Java Help Index File -->
    <pipeline message="Extract index term."
              module="IndexTermExtract"    
              basedir="${basedir}"
              tempdir="${dita.temp.dir}"
              inputmap="${user.input.file}">
      <param name="output" value="${output.dir}${file.separator}${user.input.file}"/>
      <param name="targetext" value=".html"/>
      <param name="indextype" value="javahelp"/>
      <param name="encoding" value="${args.dita.locale}" if="args.dita.locale"/>
    </pipeline>
</target>

<target name="dita.topics.javahelp" description="Build HTML files from dita topics">
  <condition property="out.ext" value=".html">
    <not>
      <isset property="out.ext"/>
    </not>
  </condition>
  <condition property="args.xsl" value="${dita.script.dir}${file.separator}dita2html.xsl">
    <not>
      <isset property="args.xsl"/>
    </not>
  </condition>
  <xslt processor="trax"
		basedir="${dita.temp.dir}"
		destdir="${output.dir}"
        includesfile="${dita.temp.dir}${file.separator}${fullditatopicfile}"
		extension="${out.ext}"
		style="${args.xsl}">
  	    <excludesfile name="${dita.temp.dir}${file.separator}${resourceonlyfile}" if="resourceonlyfile"/>
        <param name="DITAEXT" expression="${dita.ext}" if="dita.ext"/>
        <param name="FILTERFILE" expression="${dita.input.valfile}" if="dita.input.valfile"/>
        <param name="CSS" expression="${args.css.file}" if="args.css.file"/>
        <param name="CSSPATH" expression="${user.csspath}" if="user.csspath"/>
        <param name="HDF" expression="${args.hdf}" if="args.hdf"/>
        <param name="HDR" expression="${args.hdr}" if="args.hdr"/>
        <param name="FTR" expression="${args.ftr}" if="args.ftr"/>
        <param name="DRAFT" expression="${args.draft}" if="args.draft"/>
        <param name="ARTLBL" expression="${args.artlbl}" if="args.artlbl"/>
        <param name="OUTEXT" expression="${out.ext}" if="out.ext"/>
        <param name="INDEXSHOW" expression="${args.indexshow}" if="args.indexshow"/>
    </xslt>
    <antcall target="copy-css"/>
</target>

<target name="compile.Java.Help" if="env.JHHOME" description="Compile Java Help output">
  <!-- delete 'JavaHelpSearch' directory before compiling. -->
  <delete dir="${outputDir}${file.separator}JavaHelpSearch"/>
  <java jar="${env.JHHOME}${file.separator}javahelp${file.separator}bin${file.separator}jhindexer.jar"
        fork="true"
        dir="${outputDir}">
    <arg value="."/>
  </java>
</target>
<!-- end java help process -->

<!-- html help output -->
<target name="dita.map.htmlhelp" description="Build HTMLHelp HHP, HHC, HHK files">
  <condition property="out.ext" value=".html">
    <not>
      <isset property="out.ext"/>
    </not>
  </condition>
  <xslt processor="trax"
		basedir="${dita.temp.dir}"
		destdir="${output.dir}"
        includesfile="${dita.temp.dir}${file.separator}${user.input.file.listfile}"
		extension=".hhc"
		style="${dita.script.dir}${file.separator}map2hhc.xsl">
  	    <excludesfile name="${dita.temp.dir}${file.separator}${resourceonlyfile}" if="resourceonlyfile"/>
        <param name="DITAEXT" expression="${dita.ext}" if="dita.ext"/>
        <param name="OUTEXT" expression="${out.ext}" if="out.ext"/>
  </xslt>  
  <pipeline message="Extract index term."
            module="IndexTermExtract"   
            basedir="${basedir}"
            tempdir="${dita.temp.dir}"
            inputmap="${user.input.file}">
    <param name="output" location="${output.dir}${file.separator}${user.input.file}"/>
    <param name="targetext" value="${out.ext}"/>
    <param name="indextype" value="htmlhelp"/>
    <param name="encoding" value="${args.dita.locale}" if="args.dita.locale"/>
  </pipeline>
  <xslt processor="trax"
		basedir="${dita.temp.dir}"
		destdir="${output.dir}"
        includesfile="${dita.temp.dir}${file.separator}${user.input.file.listfile}"
		extension=".hhp"
		style="${dita.script.dir}${file.separator}map2hhp.xsl">
  	    <excludesfile name="${dita.temp.dir}${file.separator}${resourceonlyfile}" if="resourceonlyfile"/>
        <param name="DITAEXT" expression="${dita.ext}" if="dita.ext"/>
        <param name="OUTEXT" expression="${out.ext}" if="out.ext"/>
        <param name="HHCNAME" expression="${dita.map.filename.root}.hhc"/>
        <param name="INCLUDEFILE" expression="${args.htmlhelp.includefile}" if="args.htmlhelp.includefile"/>
    </xslt>  
</target>

<target name="compile.HTML.Help" if="HTMLHelpCompiler" description="Compile HTMLHelp output">
		<exec executable="${HTMLHelpCompiler}"
				failonerror="${failonerror}"
				failifexecutionfails="${failonerror}">
			<arg value="${projectFile}"/>
		</exec>
</target>

<target name="dita.topics.htmlhelp">
  <antcall target="dita.topics.javahelp"/>
</target>
<!-- end html help process -->

<!-- generalize a specialized topic to the base elements -->
<target name="dita.topic.generalize">
	<xslt processor="trax"
			in="${inputFile}"
			out="${outputFile}"
			style="${dita.script.dir}${file.separator}generalize.xsl">
		<!--<xmlcatalog refid="dita.catalog"/>-->
	</xslt>
</target>
  
<!-- restore the specialized elements for a previously generalized topic -->
	<target name="dita.topic.respecialize">
		<xslt processor="trax"
				in="${inputFile}"
				out="${outputFile}"
				style="${dita.script.dir}${file.separator}specialize.xsl">
			<!--<xmlcatalog refid="dita.catalog"/>-->
		</xslt>
	</target>

	<!-- add the architectural attributes with default values from the document type to the document -->
	<target name="dita.topic.normalize">
		<xslt processor="trax"
				in="${inputFile}"
				out="${outputFile}"
				style="${dita.script.dir}${file.separator}normalize.xsl">
			<!--<xmlcatalog refid="dita.catalog"/>-->
		</xslt>
	</target>

	<target name="dita.dir.normalize">
		<xslt processor="trax"
				basedir="${inputDir}"
				destdir="${outputDir}"
				includes="*.xml"
				extension=".xml"
				style="${dita.script.dir}${file.separator}normalize.xsl">
			<!--<xmlcatalog refid="dita.catalog"/>-->
		</xslt>
	</target>

	<!-- remove the architectural attributes with default values in the document type from the document -->
	<target name="dita.topic.denormalize">
		<xslt processor="trax"
				in="${inputFile}"
				out="${outputFile}"
				style="${dita.script.dir}${file.separator}pretty.xsl">
			<!--<xmlcatalog refid="dita.catalog"/>-->
		</xslt>
	</target>

  <target name="copy-css" unless="user.csspath.url" description="Copy CSS files">    
    <condition property="user.copycss.yes">
      <and>
        <equals arg1="${args.copycss}" arg2="yes"/>
        <isset property="args.css.present"/>
      </and>
    </condition>
    <property name="user.csspath.real" value="${output.dir}${file.separator}${user.csspath}"/>
    <mkdir dir="${user.csspath.real}"/>    
    <!-- Always copy system default css files -->
    <copy todir="${user.csspath.real}">
      <fileset dir="${dita.resource.dir}" includes="*.css"/>
    </copy>    
    <!-- Copy user specify css file when required -->
    <antcall target="copy-css-user"/>
  </target>

  <target name="copy-css-user" if="user.copycss.yes">
    <copy file="${args.css.real}" todir="${user.csspath.real}"/>
  </target>
    
  <target name="dita.topic.troff" description="Build troff output from dita topics">
      <!-- step 1 -->
      <xslt processor="trax"
  		basedir="${dita.temp.dir}"
  		destdir="${output.dir}"
        includesfile="${dita.temp.dir}${file.separator}${fullditatopicfile}"
  		extension="${dita.ext}"
  		style="${dita.script.dir}${file.separator}dita2troff-step1-shell.xsl">
      	  <excludesfile name="${dita.temp.dir}${file.separator}${resourceonlyfile}" if="resourceonlyfile"/>
          <param name="DITAEXT" expression="${dita.ext}" if="dita.ext"/>
      </xslt>
      
  		<!-- step 2 -->
  		<xslt processor="trax"
          basedir="${outputDir}"
          destdir="${outputDir}"
  		  includesfile="${dita.temp.dir}${file.separator}${fullditatopicfile}"
          extension=".cli"
          style="${dita.script.dir}${file.separator}dita2troff-step2-shell.xsl">
  			<excludesfile name="${dita.temp.dir}${file.separator}${resourceonlyfile}" if="resourceonlyfile"/>
  			<param name="DITAEXT" expression="${dita.ext}" if="dita.ext"/>
  		</xslt>
  	</target>
</project>