You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Wannheden, Knut" <Kn...@paranor.ch> on 2001/12/17 09:33:32 UTC

templating build files with xml

I would like to be able to dynamically create ant build files using some
kind of template.  The build files will mostly be the same with a few minor
differences.  The differences are sometimes just attributes of xml elements,
sometimes maybe small xml structures.  Is there a straight forward way how
to solve this with xml or does even ant provide some feature for templating
build files?

First I thought XSLT would be the right way, but if I have a template where
I only need to replace some small (tagged) parts, it's probably not
appropriate...

Thanks,

Knut Wannheden.

Re: templating build files with xml

Posted by Rolf Katzenberger <rf...@gmx.net>.
Hello Knut,

On Mon, 17 Dec 2001 09:33:32 +0100, "Wannheden, Knut"
<Kn...@paranor.ch> wrote:

>I would like to be able to dynamically create ant build files using some
>kind of template.
[snip]
>First I thought XSLT would be the right way, but if I have a template where
>I only need to replace some small (tagged) parts, it's probably not
>appropriate...

Why not? You can put specific matches for the tagged parts you want to
replace in the styleesheet and add a generic "copy everything" match
like this:

  <xsl:template match="@*|node()" priority="-1">
    <xsl:copy><xsl:apply-templates select="@*|node()"/></xsl:copy>
  </xsl:template>

Regards,
Rolf

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>