ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Denis N. Antonioli" <>
Subject Re: well-defined ant/xslt problem: (how) can I do this?
Date Fri, 08 Feb 2008 05:20:49 GMT

Disclaimer: this tip assumes that you're using ant 1.7

The xsl task can pass to the xsl the name of the file being processed  
(see attributes filedirparameter  and filenameparameter)

You can then:
in ant:
- use a fileset to let the xsl task process all of the changes.xml;
- use filedirparameter and/or filenameparameter to let your xsl know  
the name of the file being processed;
- pass the name of the output directory as a parameter to the xsl

in xsl:
- derive the name of the output file from the name of the input file
- use xsl extension to redirect the output to a different file

The only downside to this method is that the xsl task will create an  
empty output file, which you can delete from ant.

This is the outline of an answer ;-)


On 7 févr. 08, at 09:44, Bill Milbratz wrote:

> Hi,
> i have a problem which I don't know if I can solve elegantly with ant.
> The problem: I'd like to use the xslt task to transform these inputs  
> into
> the following outputs;
> inputs:
> v10/changes.xml
> v11/changes.xml
> v12/changes.xml
> outputs:
> v10/changes.out
> v11/changes.out
> v12/changes.out
> To clarify: the inputs lie in subdirectories. I would like the xslt/ 
> ant to
> send the outputs to "corresponding subdirectories".
> In reviewing the xslt docs, it looks like I can only send the xslt  
> output to
> one directory (destdir attribute).
> I've looked at using 'subant', but this gets pretty complex and hard  
> to
> follow.
> any suggestions?
> thanks,
> bill

The Laws of Computer Programming
* Cahn's Axiom *
When all else fails, read the instructions.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message