Rod Ayers wrote:
...
A related question:
I'd like to check and see if the property named in property.name exists.
All the "valid" properties have already been assigned default values. If
property.name exists, I will override with the value in property.value, and
set to readonly="true". Otherwise, rehect the override from the property
file as an invalid property.
I've tried this:
<if test="${property::exists('property.name')}">
With both a valid and invalid property in the property file. They both get
added because property.name exists (nuts!). I guess what I am trying to do
is double-derefernce (!)...I want to test for the property that is named in
property.name. How might that be done?
Your expression checks whether or not the property whose name is
'property.name' exists. If you want to use the value of property.name
as the name to check, omit the single quotes, i.e.,
<if test="${property::exists(property.name)}">
This treats property.name as a variable and returns the value, which is
then passed to the property::exists function. Please note that for this
second form, if the property named 'property.name' doesn't exist, then
it will throw an error.
Gary
-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc. Get Certified Today
Register for a JBoss Training Course. Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
_______________________________________________
Nant-users mailing list
Nant-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users