Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 54879 invoked from network); 30 Nov 2006 21:02:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Nov 2006 21:02:54 -0000 Received: (qmail 59033 invoked by uid 500); 30 Nov 2006 21:03:02 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 57974 invoked by uid 500); 30 Nov 2006 21:02:58 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 57963 invoked by uid 99); 30 Nov 2006 21:02:58 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Nov 2006 13:02:58 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS X-Spam-Check-By: apache.org Received-SPF: neutral (herse.apache.org: local policy) Received: from [212.227.126.171] (HELO moutng.kundenserver.de) (212.227.126.171) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Nov 2006 13:02:46 -0800 Received: from [217.81.200.102] (helo=[192.168.178.21]) by mrelayeu.kundenserver.de (node=mrelayeu6) with ESMTP (Nemesis), id 0ML29c-1Gpt330OcJ-0008RC; Thu, 30 Nov 2006 22:02:25 +0100 Message-ID: <456F46E5.1010706@oliver-heger.de> Date: Thu, 30 Nov 2006 22:02:29 +0100 From: Oliver Heger User-Agent: Thunderbird 1.5.0.8 (Windows/20061025) MIME-Version: 1.0 To: Jakarta Commons Users List Subject: Re: Variable interpolation in composite configuration References: <299BDCCE4001334C85410328E67B8799B7F658@MAILBOX02.domus.ad.sogei.it> In-Reply-To: <299BDCCE4001334C85410328E67B8799B7F658@MAILBOX02.domus.ad.sogei.it> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: kundenserver.de abuse@kundenserver.de login:060b6f3a5b4852d7db894881f1c69c62 X-Virus-Checked: Checked by ClamAV on apache.org Hi, interpolation should work with a CompositeConfiguration. There are some unit tests that check this. From your XML configuration file: > ********************** config2.xml ********************** > > > > There is an additional space before the closing curly bracket in the variable. Is this a typo? This will cause the problem. Oliver MASTRELLA STEFANO wrote: > 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 > CompositeConfiguration > > > **********************composite-config.xml********************** > > > > > > > > > and the following configuration file specified above > > **********************config1.properties********************** > key1.property=1 > > ********************** config2.xml ********************** > > > > > > As the CompositeConfiguration load first the cofig1.properties 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(); > > factory.setConfigurationURL(configURL); > > Configuration config = factory.getConfiguration(); > > String prop = config.getString("value[@name]"); > > > I'd expected to see the value "1" as defined in config.properties, > instead of ${key1.property}. > > Is there any mistakes in what I thought? > There's something more to do for variable interpolation? > > TIA > > --------------------------------------------------------------------- > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: commons-user-help@jakarta.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org