From joel@ping.net Thu Feb 15 01:19:15 2001 Return-Path: Mailing-List: contact james-dev-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list james-dev@jakarta.apache.org Received: (qmail 78731 invoked from network); 15 Feb 2001 01:19:15 -0000 Received: from ping.net (HELO server1.ping.net) (root@209.61.157.176) by h31.sny.collab.net with SMTP; 15 Feb 2001 01:19:15 -0000 Received: from ping.net (joel@[63.142.2.18]) by server1.ping.net (8.9.3/8.9.3) with ESMTP id TAA19575 for ; Wed, 14 Feb 2001 19:28:46 -0600 Sender: joel@server1.ping.net Message-ID: <3A8B2CF5.57AD48C7@ping.net> Date: Wed, 14 Feb 2001 17:12:21 -0800 From: Joel Gluth X-Mailer: Mozilla 4.73 [en] (X11; I; Linux 2.2.17 i686) X-Accept-Language: en, ja MIME-Version: 1.0 To: james-dev@jakarta.apache.org Subject: Valid XML config file in Avalon (was Re: [LONGISH] the thorny problem of MailetConfig.getInitParameterNames()) References: <3A8B1424.C35CD4BE@ping.net> <3A8B1DD6.281EDFA0@betaversion.org> <3A8B1FF5.16B873A0@ping.net> <3A8B28C9.3F324AF7@betaversion.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N Federico Barbieri wrote: > > Joel Gluth wrote: > > I know this is strictly an Avalon question now, but is there a reason > > you're allowed to specify config parameters that way, other than the > > fact that it's a neat DOM hack? > > ?... miss the question... Sorry. For example, I can configure my Mailet through Avalon's XML file like this: org.postgresql.Driver jdbc:postgresql://test01/rweiler rweiler rweiler 1235 true 2 The problem is, the document containing such an element can't be valid XML without knowing all the names of the configuration options of all the subcomponents, because it's impossible to write a DTD for. Right now, it works because you can make a DOM tree from a well-formed but invalid XML document, and then do Element.getElementsByTagName("nConnections").item(1), for example, to get the value of the nConnections option. Which is cute, but it's a hack (BTW, I have to admit that I haven't looked at the Avalon code to see if this is what happens). The convention Means that you can write a DTD for JAMES' .conf.xml file. As well as satisfying our need to be able to do discovery on a list of parameters ;) Having said all that, I understand that being able have sub-Configurations with arbitrary names, like is pretty nice, and would be much harder to do if you enforced valid XML on the Avalon config as a whole. So. We're back with JAMES. Since JAMES' MailetConfig interface is basically a very simple map of String keys to String values, it doesn't need (or even allow) all the flexibility of its underlying avalon.Configuration. It would be a good thing, I think, if JAMES enforced the second kind of tag layout. Is such a thing acceptable to the JAMES team? -- Joel Gluth \\ Disintegration Engineer, Ping.Net http://www.ping.net TCL - what a misnomer that is. For a language with such a fun name, it's pretty damn humourless.