<project name="helloworld-pdf.sample" basedir="." default="all">
	
	<property file="build.properties" />
	<taskdef name="fop" 
		       classname="org.apache.fop.tools.anttasks.Fop">
		<classpath>
			<pathelement location="${fop.home}/build/fop.jar"/>
			<pathelement location="${fop.home}/lib/avalon-framework-cvs-20020806.jar"/>
			<pathelement location="${fop.home}/lib/batik.jar"/>
		</classpath>
	</taskdef>
				
	<!--
	=================================================================
	==                                                             ==
	== CLEAN                                                       ==
	==                                                             ==
	=================================================================
	-->
	<target name="clean">
		<delete dir="${dest.dir}"/>
		<mkdir dir="${dest.dir}"/>
	</target>	
	
	<!--
	=================================================================
	==                                                             ==
	== ALL                                                         ==
	==                                                             ==
	=================================================================
	-->
	<target name="all">
		<antcall target="clean"/>
		<antcall target="pdf"/>
	</target>

	<!--
	=================================================================
	==                                                             ==
	== PDF                                                         ==
	==                                                             ==
	=================================================================
	-->
	<target name="pdf">
		
		<copydir dest="${dest.dir}/images" 
			       src="${xsl.dir}/images"/>
				
		<xmlvalidate warn="false">
			<xmlcatalog>
				<dtd publicId="${docbook.public.id}"
						 location="${docbook.dtd}" />
			</xmlcatalog>
			<fileset dir="${src.dir}">
				<include name="${source}" />
			</fileset>
		</xmlvalidate>
		
		<xslt basedir="${src.dir}" 
			    destdir="${dest.dir}" 
			    style="${basedir}/docbook-pdf.xsl" 
			    extension=".fo" 
			    includes="helloworld.xml">
			<classpath>
				<pathelement location="${lib.dir}/xalan.jar" />
			</classpath>
			<xmlcatalog>
				<dtd publicId="${docbook.public.id}" location="${docbook.dtd}" />
			</xmlcatalog>
		</xslt>
		
		<fop format="application/pdf"
			   basedir="${dest.dir}"
			   outdir="${dest.dir}"
			   messagelevel="debug"
			   userconfig="${fop.home}/conf/userconfig.xml">
			<fileset dir="${dest.dir}">
				<include name="*.fo"/>
			</fileset>
		</fop>

	</target>
</project>