Dominique Devienne wrote:

From: Alexey N. Solofnenko [mailto:[EMAIL PROTECTED]

Actually <if> is too wordy. A mall <target if="XXX"> is translated into

Complex conditions are big. A small expression language like "XXX &&
YYY" would be much nicer.

I so agree with you! That expression language could (should IMHO!) be XPath (JXpath or Jaxen are candidates, or the Xalan one?) where Ant properties would be available as XPath properties, and some of Ant's condition made into XPath functions.

The PropertyHelper aready does this in the embed proposal, since almost 2 *years*. I had written the XMLDOM task for it, and that are also Jexl and Velocity versions.


http://cvs.apache.org/viewcvs.cgi/ant/proposal/embed/src/java/org/apache/tools/ant/taskdefs/
http://cvs.apache.org/viewcvs.cgi/ant/proposal/embed/src/java/org/apache/tools/ant/taskdefs/optional/

Examples from:
http://cvs.apache.org/viewcvs.cgi/ant/proposal/embed/test.xml?rev=1.9&only_with_tag=MAIN&view=markup

    <echo message="jexl /references/myJars:
            ${jexl:ant.references.myJars}" />

    <echo message="jxPath /targets[1]: ${jxpath:/targets[1]}" />
    <echo message="jxPath /references: ${jxpath:/references}" />
    <echo message="jxPath /[EMAIL PROTECTED]'myJars']:
                     ${jxpath:/[EMAIL PROTECTED]'myJars']}" />
    <echo message="jxPath /references/myJars:
                     ${jxpath:/references/myJars}" />
    <echo message="XMLDOM:
                 ${jxpath:/references/test.xml/root/project/@name}" />

--
Nicola Ken Barozzi                   [EMAIL PROTECTED]
            - verba volant, scripta manent -
   (discussions get forgotten, just code remains)
---------------------------------------------------------------------


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



Reply via email to