ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Jan.Mate...@rzf.fin-nrw.de>
Subject AW: Replace filter + strip quotes
Date Fri, 26 Mar 2010 05:11:47 GMT
If you dont need the quotes, just delete them.
Otherwise the easiest way is using a second property withouth the quotes and use that:

# Quotes are invalid in the generated files, so provide a value without them
my.property.value=XYZ Software Company
# Original value refering to the other for DRY
my.property="${my.property.value}"


So use the *.value in your template and the 'real' everywhere else


Jan

> -----Ursprüngliche Nachricht-----
> Von: Daniel Becroft [mailto:djcbecroft@gmail.com] 
> Gesendet: Freitag, 26. März 2010 00:38
> An: user@ant.apache.org
> Betreff: Replace filter + strip quotes
> 
> Hi,
> 
> I am trying to use <replace /> and <replacefilter /> to 
> generate a html page
> from a template, based on certain properties for the build 
> (version number,
> etc). However, one of the properties I am trying to replace 
> contains quotes,
> as it has spaces in it.
> 
> e.g.
> build.properties
> my.property="XYZ Software Company"
> 
> When this is replaced into the generated html file, it brings 
> the quotes
> across. Is there a simple method of stripping the quotes 
> (either before or
> after the replace)?
> ---
> Daniel Becroft
> 

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


Mime
View raw message