Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 86026 invoked from network); 11 Dec 2007 20:49:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Dec 2007 20:49:52 -0000 Received: (qmail 87219 invoked by uid 500); 11 Dec 2007 20:49:37 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 87158 invoked by uid 500); 11 Dec 2007 20:49:36 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 87149 invoked by uid 99); 11 Dec 2007 20:49:36 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Dec 2007 12:49:36 -0800 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_HELO_PASS,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [212.227.126.183] (HELO moutng.kundenserver.de) (212.227.126.183) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Dec 2007 20:49:38 +0000 Received: from [192.168.178.20] (p5B098E38.dip0.t-ipconnect.de [91.9.142.56]) by mrelayeu.kundenserver.de (node=mrelayeu1) with ESMTP (Nemesis) id 0MKwpI-1J2C2W1gKL-0006x4; Tue, 11 Dec 2007 21:49:16 +0100 Message-ID: <475EF7CC.7000805@oliver-heger.de> Date: Tue, 11 Dec 2007 21:49:16 +0100 From: Oliver Heger User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: Jakarta Commons Users List Subject: Re: [Commons Configuration] XML Schema support, and other questions References: <22C5A81B3491F241BF9447DC9C79E24D059B1677@modmsx011.network.local> In-Reply-To: <22C5A81B3491F241BF9447DC9C79E24D059B1677@modmsx011.network.local> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V01U2FsdGVkX19rN8jT8VUs6MlF3ao4lNZ/gLZSB9g6vDTlwe2 lL3cMuwCXp9bP/xj5Xkcg0Prp2MJPpboZrLmU9R8gALvzLCRao GWAahgQVHQ3Se9qx/MUvg== X-Virus-Checked: Checked by ClamAV on apache.org Hi, comments inline... Spies, Brennan wrote: > Hi all, > > > > I am considering using Commons Configuration for my project, but am not sure > if I would be able to do the type of configuration that I want. > > > > Some background: > > > > I am writing a project that uses two sources of configuration, LDAP and XML > (local). The LDAP properties represent "reserved" (user cannot override) and > "default" properties (user can override), while the local XML file > (user-defined) represents all the user-controlled configuration > properties-some have defaults in LDAP, some don't. The CompositeConfiguration > seems to support that, so far so good. CompositeConfiguration and also DefaultConfigurationBuilder allow to define an order of configuration sources in which to search for properties. So if your configurations are correctly ordered, you can achieve the desired behavior. > > > > The XML file is defined by an XML Schema, and has namespaces associated with > it. Namespaces seems to muck with XPath expressions, as you have to use XPath > functions like 'local-name()' to correctly get the path. It looks like > Commons Configuration only supports DTDs...:-( > That's right, so far only DTDs are supported. > > > The other thing that I am doing is using a mix of properties (key = value) > and actual beans which I am binding (on the XML end) using JAXB. Not sure if I understand this requirement correctly. You can parse a XML file with XMLConfiguration no matter of its content. If some parts of the document do not represent properties, they do not disturb the parsing process. As long as you specify the correct keys to your properties you can access them. HTH Oliver > > > > So, can I achieve what I want using Commons Configuration and maybe a little > custom coding? Or should I write this one myself? > > > > > > Thanks, > > > > Brennan > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@commons.apache.org For additional commands, e-mail: user-help@commons.apache.org