ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From michael.gir...@objectweb.org
Subject How do I get the value of a property using a variable property name?
Date Fri, 28 May 2004 13:53:11 GMT
Is it possible to get the value of a property using a property value as 
the name?

The example is a bit contrived, and could be accomplished using the actual 
property names, but it does help to illustrate the question.

<property name='a.root' value='aroot_value'/>
<property name='b.root' value='broot_value'/>
<property name='pfx' value='a'/>  <!-- actually computed or from a 
property file -->
<property name='key' value='root'/>
<property name='target' value='${pfx}.${key}'/>

<!-- 
 so now the value of target is a.root, and I want the
 value of a.root assigned to the property named 'val'.
  -->
<property name=val' valueOf='${target}'/>

Michael Giroux

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


Mime
View raw message