<?xml version="1.0"?>

<project name="gexslt_extensions_doc" default="help">

	<description>
		description: "Gobo Eiffel XSLT Extensions documentation"
		system: "Gobo Eiffel XSLT"
		copyright: "Copyright (c) 2004, Colin Adams and others"
		license: "Eiffel Forum License v2 (see forum.txt)"
		date: "$Date: 2005/07/07 13:36:30 $"
		revision: "$Revision: 1.2 $"
	</description>

	<target name="help">
		<echo message="usage:"/>
		<echo message="   geant install"/>
		<echo message="   geant clean"/>
		<echo message="   geant clobber"/>
	</target>

	<target name="install">
		<description>
			Install the Gobo Eiffel XSLT Extensions documentation.
		</description>


		<set name="xslt_processor" value="gexslt" unless="$GOBO_XSLT_PROCESSOR"/>
		<set name="xslt_processor" value="${GOBO_XSLT_PROCESSOR}" if="$GOBO_XSLT_PROCESSOR"/>

		<set name="previous" value="index"/>
		<set name="current" value="index"/>
		<geant target="xslt_and_shift" arguments="index"/>
	</target>

	<target name="clean">
		<description>
			Remove intermediary generated files.
		</description>

		<!-- do nothing -->
	</target>

	<target name="clobber">
		<description>
			Remove all generated files.
		</description>

		<delete file="index.html"/>
	</target>

<!-- Implementation -->

	<target name="xslt_and_shift" export="NONE">
		<description>
			Call `xslt' and shift variables `previous' and `current' one chapter forward.
		</description>
		<argument name="a_next"/>

		<geant target="xslt" arguments="${previous},${current},${a_next}"/>
			<!-- Shift parameters -->
		<set name="previous" value="${current}"/>
		<set name="current" value="${a_next}"/>
	</target>

	<target name="xslt" export="NONE">
		<description>
			Execute XSL Transformation for argument ${a_file}, ${a_previous}
			and ${a_next} using processor ${xslt_processor}.
		</description>
		<argument name="a_previous"/>
		<argument name="a_file"/>
		<argument name="a_next"/>

		<xslt processor="${xslt_processor}" input="${a_file}.xml" output="${a_file}.html" stylesheet="${GOBO}/doc/misc/gobo2html2.xsl">
			<parameter name="previous" value="&quot;'${a_previous}.html'&quot;"/>
			<parameter name="next" value="&quot;'${a_next}.html'&quot;"/>
			<parameter name="toc" value="&quot;'index.html'&quot;"/>
			<parameter name="images" value="'../../image/'"/>
		</xslt>
	</target>

</project>
