ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: Creating EJB Deployment Descriptors
Date Wed, 29 Aug 2001 06:18:23 GMT

Thanks for your solution. It works very well. I have one more question
though, more related to xslt than Ant

Following your solution, I have made the following files. There is a
ejb-jar-values.xml of the following format.

          <name> value for dev </name>
          <name> value for stage </name>

The ejb-jar.xsl template file needs to pick up the values from the
ejb-jar-values.xml file based on dev/stage and create ejb-jar.xml file. How
do I make ant tell the xsl file that it has to pick up either of the
dev/stage elements for the needed values. The param element of style task
did not work.

- Siva

List:     ant-user
Subject:  Re: Creating EJB Deployment Descriptors
From:     "Kyle Adams" <>
Date:     2001-08-08 17:09:28
[Download message RAW] 08/08/01 11:37AM:
> If you need more info, or are unfamiliar with XSLT, I'd be willing to
> post some resources that I've found helpful.

Well, it seems there is some interest in this.

DISCLAIMER: I'm pretty inexperienced with XSLT.  Until about a week
ago, I had no experience.  Then a project of mine evolved to the point
that XSLT was necessitated, so I've been on a crash course for about a
week.  These resources come from the perspective of a newbie, for fellow

I've been to,, (and probably a few
others) to read their respective intros to XSLT.

At - a column on XSLT



In general, I've found the articles to be the best as far
as being understandable and being most applicable to Ant.  The stylesheets
I'm using now are based (very loosely) off of the ones presented in the articles.

I use Saxon as my XSLT parser, as it was recommended to me by other
XSLT gurus on this list.

The Saxon User Manual has also been a nice "pocket reference" for XSLT.

Specifically, I'm constantly referring to the pages on XSL elements and

I've given remote links here, but the user manual is also included when you
download Saxon.

Lastly, be sure to check all the XSLT-related posts on this list by
the archives at:

A few final words: the articles gave me a good idea (at least,
think it's good) on how utilize XSLT in my Ant files.  This, to me, has
the toughest part about diving into XSLT - figuring out exactly what from
Ant script should be in the XSL file, and what should be in the XML file.
what I've ended up with (presented in an abridged and snipped format):

<xsl:variable name="PROJECT_NAME" select="application/@name"/>

<xsl:template match="application">
  <project name="{$PROJECT_NAME}" default="all" basedir=".">
    <!-- load property files, specify the init target, all general "build"
file things here -->
    <xsl:apply-templates select="build"/>

<xsl:template name="compile" match="target[@name='compile']">
  <target name="compile" depends="init">
    <!-- do various compiling-type things here -->

<application name="foo">
  <build default="clean, compile">
    <target name="get"/>
    <target name="clean"/>
    <target name="refresh"/>
    <target name="compile"/>
    <target name="deploy"/>

Sorry for the long post, but this is one of the topics in the Ant community
that is least documented, and most in need of documentation.  Maybe I'll
have to sit down and write something out one of these day :-)  Eh, better
wait until I have some more experience...


> List:     ant-user
> Subject:  Creating EJB Deployment Descriptors
> From:
> Date:     2001-08-08 9:31:20
> [Download message RAW]
> We have three ejb-jar.xml files for each EJB, one each for
> development/staging/production environment. Right now we are maintaining
> them as, ejb-jar.xml.stage, files. Ant
> picks up the respective files depending on the environment for which the
> build is made.
> Now I am looking for a more elegant solution. The proposed way is as
> follows. I have a ejb-jar.xml.template file and a properties file which
> will contain all the values for all the environments. Reading the
> respective property values, I am planning to insert them in the
> ejb-jar.xml.template file using 'Replace' task of Ant.
> Is this is standard way of doing this kind of stuff? Or is there any
> simple, elegant way of doing the same?
> Thanks,
> Siva

View raw message