Hello,
XSLT preprocessor will help. You can create a template for node <project-target
name="utils"> and then use "{@name}" in the template to be substituted with project
name.
Example build.xml (I call Xalan externally because I run the script from JBuilder and
it is difficult to specify relative classpath there):
=====================
<property name="build" value="real_build.xml"/>
<property name="xsl" value="rreal_build.xsl"/>
<property name="generated_build" value="real_build_gen.xml"/>
<target name="script-check">
<uptodate property="scriptUptodate" targetfile="${generated_build}">
<srcfiles dir="." includes="${build},${xsl}"/>
</uptodate>
</target>
<target name="script" depends="script-check" unless="scriptUptodate">
<echo message="Generating build script..."/>
<java classname="org.apache.xalan.xslt.Process" fork="yes" failonerror="yes">
<arg value="-IN"/>
<arg value="rv_build.xml"/>
<arg value="-XSL"/>
<arg value="rv_build.xsl"/>
<arg value="-OUT"/>
<arg value="rv_build_gen.xml"/>
<classpath>
<pathelement path="Runtime/ThirdParty/lib/xalan.jar"/>
<pathelement path="Runtime/ThirdParty/lib/xerces.jar"/>
</classpath>
<sysproperty key="org.xml.sax.driver"
value="org.apache.crimson.parser.XMLReaderImpl"/>
</java>
</target>
<target name="make" depends="script">
<echo message="Executing build script..."/>
<ant antfile="${generated_build}" target="${target}"/>
</target>
============================
!! Do not forget to add "default" template into your XSLT:
============================
<xsl:template match='@*|node()' >
<xsl:copy>
<xsl:apply-templates select='@*|node()'/>
</xsl:copy>
</xsl:template>
============================
Sincerely,
Alexey Solofnenko.