ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicola Ken Barozzi <>
Subject Re: ReferenceHelper - interceptor
Date Thu, 23 Jan 2003 13:17:42 GMT

Stefan Bodewig wrote:
> On Thu, 23 Jan 2003, Nicola Ken Barozzi <> wrote:
>>Stefan Bodewig wrote:
>>>On Wed, 22 Jan 2003, Dominique Devienne <> wrote:
>>>>Didn't understand a thing ;-)
>>>Me neither 8-)
>>Good, it means that I was right in my supposition.
> Not necessarily.  I'm focussing on bug fixing and getting 1.5.2 out of
> the door before I really dive into the stuff originating from the
> embed proposal.
> Let's say, I don't understand property-interceptors and why they are
> needed either 8-)

Simple, make it possible to add property resolution systems.

A property is now a simple value, but it's very convenient that it can 
be the result of an expression.

When I started using it in Centipede some time back, I created this 
document. Maybe it can be reused in Ant.

A concrete example, that is also explained in the document, is about 
getting values from xml.

  I have written a <xmldom> typedef that reads an xml file and puts it 
in the references. So, let's say I want to load the build.xml file as a 
DOM, and echo the project name:

   <!-- The DOM of file test.xml is referenced via the id-->
   <xmldom id="build.xml" file="build.xml"/>
   <echo message="${jxpath:/references/build.xml/root/project/@name}" />

Other examples with xmldom:

  top-level property values (separated by comma):

  top-level property values that have name "p":

Final functionality: Let's say that I want to get the top-level property 
values that have the name defined in *another* Ant property, called pp:


JXpath expands all $ xpath variables using the Ant properties.

>>It's theorically possible to do the same with references, and give
>>the possibility of having an interceptor to give the reference.
> IMHO, references and properties should be as similar as possible -
> note that this broad statement is backed by a total lack of insight
> into the PropertyHelper thing.

Well, they are not really.

    refid="blah"    <--->   ${blahvalue}

There is a level of indirection that makes it possible for me to do the 
following but not the opposite:


With interception for properties, I can do:


As you see, the interceptor can get me a property from a reference too:


IMHO it could be confusing for users to have the possibility of doing:




What the user would ant to intercept with the above is not the reference 
per se, but its name. And its name is a property.


can also be done by


I guess, no?

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