ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: Transforming a text file line by line with ant.
Date Tue, 04 May 2010 08:02:16 GMT
On 2010-05-04, Marco Faustinelli <> wrote:

> I have to write an xml file from a csv file inside an ant script. The
> way the csv lines are transformed depends on a very much complex
> choice, so using XSLT is excluded. Please just trust me on this one.

> My idea would be to split the csv files into lines and process each
> line using a class which extends ProjectComponent and implements
> TokenFilter.Filter.

Sounds right.

> I have seen yesterday that filters can be called more than once per
> line,

They can?  Yesterday we talked about mappers acting on file names.
filters shouldn't be invoked multiple times.  In which situation do you
see such a behavior?

> ...Is this feasible and reliable, or is it just trying to fix a square
> peg in a round hole?

No, filters are exactly what you want to use.  You may need to throw in
additional classes into your filterchain that will ensure you get the
correct root element and closing tag (likely ConcatFilter will do), but
this is exactly the right extension point in Ant for a task like this.


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

View raw message