.duncan wrote:
> > <compileTask srcdir="lib" destdir="lib">
> > <taskdef name="xslt" classname="Xslt" />
> > </compileTask>
>
> Ok, but where is the xslt task being used? Could you expand
> the example?
The following is adapted from xml-fop/build.xml:
<project default="codegen" basedir=".">
<target name="codegen" depends="prepare">
<compileTask srcdir="lib" destdir="lib">
<taskdef name="xslt" classname="Xslt" />
</compileTask>
<xslt infile="${Courier.xml}"
xsltfile="${fontfile.xsl}"
outfile="${build.src}/fonts/Courier.java"
smart="yes" />
</target>
</project>
Note: I am no longer in favor of this approach. I prefer Stefan's:
<project default="codegen" basedir=".">
<target name="codegen" depends="">
<javac srcdir="lib" destdir="lib" />
<taskdef name="xslt" classname="Xslt" />
<xslt infile="${Courier.xml}"
xsltfile="${fontfile.xsl}"
outfile="${build.src}/fonts/Courier.java"
smart="yes" />
</target>
</project>
And I like Matt's even better (mildly):
<project default="codegen" basedir=".">
<javac srcdir="lib" destdir="lib" />
<taskdef name="xslt" classname="Xslt" />
<target name="codegen" depends="">
<xslt infile="${Courier.xml}"
xsltfile="${fontfile.xsl}"
outfile="${build.src}/fonts/Courier.java"
smart="yes" />
</target>
</project>
If the consensus is on Stefan's approach, the best way to implement this is
to revert to a DOM based appoach (through JAXP this time), but simply
configuring the tasks from the XML in a just in time manner.
- Sam Ruby