ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Naresh Bhatia" <NBha...@sapient.com>
Subject RE: Deploying to multiple servers
Date Sat, 08 Mar 2003 14:52:46 GMT
I do need a little XSLT help with this solution. I am trying to produce
the following property in the output build file:

    <property name="server-name" value="server1"/>

Here's is roughly the XSL I want - the value attribute coming from my
input file. Obviously this is not valid XML, but I don't know how to fix
it:

    <property name="server-name" value="<xsl:value-of
select="@name"/>"/>

Another approach that did work for me is shown below, but this no longer
is a "template" and is not readable as a build file:

    <xsl:element name="property">
      <xsl:attribute name="name">node-name</xsl:attribute>
      <xsl:attribute name="value"><xsl:value-of
select="@name"/></xsl:attribute>
    </xsl:element>

Any suggestions?
Thanks.
Naresh

-----Original Message-----
From: Mike McNally [mailto:m5@works.com] 
Sent: Friday, March 07, 2003 4:17 PM
To: Ant Users List
Subject: Re: Deploying to multiple servers


> I need to write an ant script to deploy to multiple servers. The 
> number of servers and their properties should be configurable.

I'm finding that using XSL to translate a smaller XML build spec into an
Ant build XML file works wonders for such special purposes. You don't
have to do anything icky in Ant.  All you maintain is the translating
stylesheet that captures the Ant targets/tasks 
you want to generate based on your needs.  Your Ant build then has a
target that runs <xslt> to generate the output build file from your
smaller spec file, and then uses <ant> to call a target in that
generated file.


--
[ you are my main foo ] Mike McNally -- m5@works.com

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message