--- [EMAIL PROTECTED] wrote:

> I've been testing the <condition> task and either it
> is very limited in its functioning or I am carrying
> the wrong mental model into the exercise.

Charles, I am going back to your initial mail to
address your statement of having the wrong mental
model.  Here is where you originally hit the
proverbial nail on the head.  Ant's condition task was
designed with the simplest paradigm in mind:  if, if,
if.  <condition>'s 'else' attribute is a recent
addition as the manual attests (since 1.6.3, which for
all practical purposes, means since 1.6.5, i.e. the
current version).  'else' can be used for convenience
when you don't want to say:

<condition name="foo" value="foo">
  <equals arg1="${arg}" arg2="FOO" />
</condition>

<condition name="foo" value="bar">
  <not><equals arg1="${arg}" arg2="FOO" /></not>
</condition>

Obviously here it is easy to use:

<condition name="foo" value="foo" else="bar">
  <equals arg1="${arg}" arg2="FOO" />
</condition>

So for more complex situations you could simply use
multiple conditions as you would e.g. multiple ifs in
code, arranged from highest to lowest priority.  But
for the particular task you are describing here, I
might well take Antoine LL's advice and write a custom
task.

HTH,
Matt
> 
> I work mostly in XSLT these days. There I can set
> the value of a variable by testing any number of
> conditions and nested conditions using the
> <xsl:choose> element.
> 
> <condition> appears to be based on the
> "if-then-else" model. What I'm looking for is a
> means of setting a property on the
> "if-then-else-elsif" model.
> 
> Is there some way of doing this with ant 1.65 as it
> stands or do I have to write an extension to
> accomplish this?
> 
> Thanks.
> 
> -- 
> Charles Knell
> [EMAIL PROTECTED] - email
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to