ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craeg K Strong <cstr...@arielpartners.com>
Subject Re: if and unless attributes for all Tasks
Date Wed, 16 May 2001 23:23:17 GMT
Hello:

Here is a thought:   We at Ariel Partners defined a grammar for 
expressing boolean logic in XML,
which we used for certain simple XSLT transformations, way long ago, 
completely unrelated to Ant.  
I thought I would share it with the list because we seem to currently be 
in a "share illustrative examples" mode...

Here are a few sample snippets:

<And>
   <When>
       <SwitchName>OS Family</SwitchName>
       <Value>Solaris</Value>
    </When>
    <When>
        <SwitchName>Capability</SwitchName>
        <Value>Email server</Value>
     </When>
</And>
....
<Or>
   <When>
      <SwitchName>Capability</SwitchName>
      <Value>Development host</Value>
   </When>
   <When>
       <SwitchName>Capability</SwitchName>
       <Value>Web server</Value>
    </When>
</Or>
....
<Not>
    <When>
       <SwitchName>Capability</SwitchName>
        <Value>Email server</Value>
     </When>
</Not>

Needless to say, our "When/And/Or/Not" elements perform a very similar 
function to that of Ant's "if" and "unless" attributes.  
Here are some of the potential advantages of the above type of approach:

- can easily use the boolean elements anywhere you like (project, task, 
target, ....)
- do not require everybody to add attributes to their elements [ adding 
if and unless attributes to every task? yikes! ]
- very easy to read and understand
- the DTD is extremely simple and regular

The intent of this example is merely to add another (hopefully relevant) 
data point to this discussion.   TIFWIW.

Regards,

--Craeg Strong

-- 
Craeg K. Strong                               | www.arielpartners.com
Ariel Partners LLC		              | cstrong@arielpartners.com 
85 River Street, Ste. 3A                      | Fax:      (781) 647-9690
Waltham, MA 02453                             | Voice:    (781) 647-2425




Mime
View raw message