ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Angus McIntyre <an...@pobox.com>
Subject FilenameMapper with multiple mappings?
Date Sat, 18 Jan 2003 21:47:36 GMT
I've written an Ant task that uses Xalan to do XSLT transformations 
(plus one or two other little things, which is why I didn't just use 
Style or Styler). It works fine, but I've just run up against a 
problem.

The task is based on Copy, which allows a single Mapper. I need to 
specify several mappings, i.e. "*.xml" --> "*.html", "*.php" --> 
"*.php" etc. As far as I can see, there's no way to do this with any 
of the existing Mapper types.

I can think of several approaches that I might take.

One would be to define a new FileNameMapper type, so as to be able to 
do something like:

	<mapper type="multiglob" from="*.xml,*.php" to="*.html,*.php"/>

However, it's not immediately clear to me how easy it would be to 
integrate this, given the way mapper implementations are defined. It 
looks to me as if I'd need to hack Mapper to make this work.

Another approach might be to override 'createMapper()' in my task 
implementation to allow multiple mappers to be defined for a task. 
This would work, but might also require me to override 'buildMap()'.

What would be the best (and quickest) way to be able to do what I 
want? Or am I missing some existing feature that would allow me to do 
this without changing anything?

Thanks,

	Angus
-- 
angus@pobox.com                             http://pobox.com/~angus

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message