commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Variable interpolation in composite configuration
Date Thu, 30 Nov 2006 10:22:17 GMT
Hi everybody,

What I need to is to reference some key in a configuration file from
another config file.
As an example cosider to have this configuration file for the


<?xml version="1.0" encoding="ISO-8859-1" ?>

  <properties fileName=""/>
  <xml fileName="config2.xml"/>

and the following configuration file specified above


********************** config2.xml **********************

   <value name="${ }"/>

As the CompositeConfiguration load first the when I
try to look for the key "value[@name]" or "value/@name" (xpath version)
with this snippet of code

ConfigurationFactory factory = new ConfigurationFactory();

URL configURL = new File("config-composite.xml").toURL();


Configuration config = factory.getConfiguration();

String prop = config.getString("value[@name]");

I'd expected to see the value "1" as defined in,
instead of ${}.

Is there any mistakes in what I thought?
There's something more to do for variable interpolation?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message