Daniel T. Gorski wrote:
Hi,
I ran into a problem with XMLConfiguration, that seems be not very well
documented: its the interpolation of ${key} within XML attributes.
Well, here is an example:
<foo>
<bar attribute="${key}" />
</foo>
My problem here is, how do I initialize the value of ${key}, so that
XMLConfiguration#getProperty() returns the complete interpolated and
replaced string? Can anybody give me a short example?
Searching the source code wasn't very successful as the interplation methods
are protected.
TIA, regards dtg
At the moment the key will be interpreted as the name of another
property and this property's value will be returned. As an example
consider the following:
<config>
<foo>
<bar attribute="${values.test}"/>
</foo>
<values>
<test>42</test>
</values>
</config>
Given this configuration file, a
config.getProperty("[EMAIL PROTECTED]") will return 42.
There are plans for enhancing the interpolation facilities. Have a look
at the following enhancement request:
http://issues.apache.org/bugzilla/show_bug.cgi?id=35116
HTH
Oliver
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]