This is not a detailed answer but I do have a couple of thoughts on this:

You can pretty easily use Ant to run a style task that builds your real buildfile. 
Then run an ant task to call that file.
I'd tend to keep my style calling build file pretty simple.

I suspect most of the problems that will arise will have to do with generating 
parameter references properly.

To generate a parameter reference I'd suggest something like:

<xsl:variable name="attribVal" select="'${paramName}'"/>
<taskName attrib="$attribVal"/>

There are various reasons you might want to generate an Ant file with XSL but one of 
the reasons I suggested embedding the
mini-stylesheet in an Ant file was to have integration with FileSets. Using XSLT to 
generate a build file loses this.

Also while I still think Ant could use a dynamic element and that my XSLT proposal is 
viable (given the way the world is going
knowing some XSLT would be beneficial for almost anyone working with XML in any 
fashion) I'd place a higher priority on having Ant
provide an abstract FileSet aware task that would be the basis for most of the core 
tasks.

Sorry if this was a little vague. If you have a specific problem you'd like to solve 
by using XSLT to create your build file drop me
a line and I'll do my best to provide an example of how it could be tackled.

HTH
Brett Knights


> -----Original Message-----
> From: Kyle Adams [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 03, 2001 1:27 PM
> To: [EMAIL PROTECTED]
> Subject: Re: XSLT (was Re: for-each (another proposal))
>
>
> [EMAIL PROTECTED] wrote:
> > And this is all to avoid learning a templating language. Even
> > though that language is potentially a standard language whos
> > basics could be understood in .... what about 40 minutes?
>
> [EMAIL PROTECTED] wrote:
> > I still can't understand how you can claim that if/them and
> looping are
> > too complex and then turn around and suggest we use XSLT instead.
>
> Apart from all the abrasive debate currently surrounding this
> topic, I WOULD be interested in learning how to use XSLT to
> dynamically generate build files... HOWEVER, I haven't been
> able to find a good tutorial on it yet.  While something on
> using XSLT to format XML documents in general is nice, what
> I'm really looking for is a tutorial on how to use XSLT to
> build an Ant script dynamically.  Furthermore, if the
> tutorial was written specifically to address the umpteen "I
> need to ______ a directory which may or may not have x
> subdirectories in it" posts out here, that would be fantastic.
>
> From my point of view, Pete's position would be more valid if
> there was something educational out there on how to handle
> these situations properly (from an "anti-control flow,
> pro-templating" perspective).  This perspective is a
> different way of approaching things (that's true for Ant in
> general), and until I find some good in-depth explanations of
> this different solution, I have to fall back on what I know
> (control structures).
>
> I would like to use XSLT in conjunction with Ant, I just need
> to be shown how.  So does anyone out there know of anything
> like this, or would be willing to whip up something like this?
>
> Kyle
>
>

Reply via email to