ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Upayavira ...@upaya.co.uk>
Subject Re: Property resolution in a task
Date Mon, 17 Nov 2003 11:15:12 GMT
Jan.Materne@rzf.fin-nrw.de wrote:

>String org.apache.tools.ant.Project.replaceProperties(String value)
>
>would help here.
>  
>
Absolutely splendid. I thought it might be that simple.

One further question - I've looked deeper into the Cocoon code, and can 
see that we have a DOM node for which I want to replace properties for 
all attributes and text nodes. I've been assuming that I'll need to do 
that myself. Is there an Ant way to 'spider' a DOM node, replacing 
properties as it goes?

(You gotta ask!)

Many thanks for this.

Regards, Upayavira

>
>    /**
>     * Replaces ${} style constructions in the given value with the
>     * string value of the corresponding data types.
>     *
>     * @param value The string to be scanned for property references.
>     *              May be <code>null</code>.
>     *
>     * @return the given string with embedded property names replaced
>     *         by values, or <code>null</code> if the given string is
>     *         <code>null</code>.
>     *
>     * @exception BuildException if the given value has an unclosed
>     *                           property name, e.g. <code>${xxx</code>
>     */
>
>
>Jan
>
>
>  
>
>>-----Original Message-----
>>From: Upayavira [mailto:uv@upaya.co.uk]
>>Sent: Monday, November 17, 2003 11:12 AM
>>To: dev@ant.apache.org
>>Subject: Property resolution in a task
>>
>>
>>In Cocoon we have an Ant task for patching our config files.
>>
>>I'd like to extend this to be able to expand properties found in the 
>>patch files.
>>
>>How can I, in a Task, expand properties within a String?
>>
>>For example, if I have a string that says 
>>"${local.mounttable}", I want 
>>to replace it with the value of local.mounttable that has been taken 
>>from our property file.
>>
>>Thanks for any help.
>>
>>Regards, Upayavira
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
>>For additional commands, e-mail: dev-help@ant.apache.org
>>
>>    
>>
>
>  
>



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message