ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicola Ken Barozzi <>
Subject Re: <comment> task
Date Thu, 08 Jan 2004 17:32:53 GMT
Dominique Devienne wrote:

>>From: Jose Alberto Fernandez []
>>>Hey Peter, can't you code that? ;-) --DD
>>It already exists, it is called velocity. ;-)
> I always thought velocity was a templating tool,
> so I don't see it's relation to calling arbitrary methods
> on objects referred to from Ant references... --DD

It's just the velocity property stuff that's really used here.
Here is the example of all this stuff.


<target name="dynamicProperties" depends="init">
   <taskdef classname=""
              name="jxpath" />
   <taskdef classname=""
              name="jxpathSet" />
              name="velocityProperties" />
              name="jexlProperties" />

     <!-- Init JxPath. '/' is the project -->

     <echo id="foo" message="Starting dynamic props tests" />

     <echo message="Value: ${vm:$}" />
     <jxpathSet path="/references[@name='jxpathTask']/foo" value="Test"/>
     <echo message="Value: ${vm:$}" />

     <echo message="${}" />
     <echo message="Value: ${vm:$}" />

      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 /references[@name='myJars']: 
${jxpath:/references[@name='myJars']}" />
     <echo message="jxPath /references/myJars: 
${jxpath:/references/myJars}" />

     <!-- This is - a datatype that holds an xml DOM  -->
     <typedef name="xmldom"

     <!-- Init XMLDOM. The DOM of file test.xml will be referenced via
          the id-->
     <xmldom id="test.xml" file="test.xml"/>

  message="XMLDOM: ${jxpath:/references/test.xml/root/project/@name}" />


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

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message