On 2010-05-04, Marco Faustinelli <[email protected]> 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.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to