ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jose Alberto Fernandez" <j_a_fernan...@yahoo.com>
Subject RE: [VOTE] procedural versus purely declarative
Date Mon, 23 Apr 2001 19:04:14 GMT
> From: Peter Donald [mailto:donaldp@apache.org]
>
> At 04:38  23/4/01 +0100, Jose Alberto Fernandez wrote:
> >XSLT is nice for little things. But it is a language 10
> times more complex
> >than ANT. If that is the alternative we are givin real
> users, I do not think
> >it will be useful for 90% of them. I also fail to see how you can do
> >property expansion and such using plain XSLT. Without that
> we have non of
> >the power of ANT.
>
> Can you give me a (good) use case where XSLT would not suffice?
>

The AutoConfig style of doing things which is what I think of when you talk
about XSLT is only for static expansions. How do you do when the expansion
is dynamic (i.le., it depends on the result of the execution of other ANT
tasks. How does XSL knows what to expand if it has not been generated yet?

We have several tasks that generate source code for our project.

Had we had to apply tasks to each of the generated files, like for example
run <rmic> on the compiled files, I do not see how XSLT could do that
simply. Fortunately that is not our case, but it is not a far fetch example.


> >Humm, by this reasoning, we could remove fileset wild
> characters since we
> >can achieved the same thing using templates ;-)
>
> Exactly ! But thats gonna have to wait a bit longer till we
> have a decent
> autoconf like tool about ;) Currently one of the reasons ant fails for
> large projects is because it doesn't have this. Luckily it
> makes up for it
> with a low execution time and lots of in-JVM stuff.
>

So, how do you say in XSLT "find all files with extension .java in a
directory stored in a ${property}"? Is it as simple as:

	<fileset dir="${property}" includes="**/*.java" />

> >Of course the point is simplicity of use. I am not sure we
> will gain that
> >with XSLT. We will need something taylored to ANTs needs.
>
> Feel free to create a new language - xslt has the advantage of being
> standard and well known. Sure it is not very pretty or simple
> but every
> alternative is complex. If you have looked at any of the
> alternate systems
> that aren't just a morass of scripts (ie automake, imake,
> etc) they all
> have that complexity/power balance.
>
> Now look at systems who have tried to do xslt but more simply
> - theres a
> few around (Cocoons XSP at xml.apache.org is an example). Now
> how many of
> them achieve any measure of simplicity over XSLT - at what
> cost do they do
> it ? (ie loose power, completely new/foreign etc).

The question is not: how complex/simple should be the template mechanism for
ANT? but: Is a template mechanism the best way to provide what ANT needs?

I am not sure, the answers to the second question is "yes".

There are other ways to provide iteration over tasks or targets.

Do not get me wrong, I see room for templates in order to apply preferences
(eliminate magic proparties), or defining new tasks based on existing ones
(a la macro ;P ), but it is not a panacea.

Jose Alberto


Mime
View raw message