comp.lang.ada
 help / color / mirror / Atom feed
From: Darren New <dnew@san.rr.com>
Subject: Re: Use of XML for config files
Date: Thu, 13 Jun 2002 16:39:49 GMT
Date: 2002-06-13T16:39:49+00:00	[thread overview]
Message-ID: <3D08CAF0.846AA176@san.rr.com> (raw)
In-Reply-To: 4519e058.0206130553.3ee195f1@posting.google.com

Ted Dennison wrote:
> Ewwww. I'd forgotten about that issue. Do we (assming XML use)
> actually intend to enforce this bit of nastyness to maintain
> theoretical XML compliance, or do we bend the rules to make it a bit
> easier to use for people who aren't XML experts?

The minute you bend the rules, you might as well throw out the pre-written
XML parsers and all the XML tools. The moment you don't escape < in a
PCDATA, you're screwed.

Georg Bauhaus wrote:
> Isn't the goal to get useful information for configuring our software?
> Or about maximization of easiness of configuration file parsing?

I think the goal is to get a useful configuration facility that allows
hand-editing of configuration files by non-programmers without the need for
a specialized editor.

> Understanding starts at understanding the contents and the structure,
> not the syntax.  That's essential.

No, it starts at the syntax, because if you can't read it, you can't even
learn the contents and structure. As proof, consider a configuration file
that's a dump of a stream. Lots of structure, all the contents you need,
opaque syntax. Take a look and tell me what's in it.

> How does one capture dependencies of settings in kv pairs?

In documentation, just like you would in XML. If you think XML can show the
relationship between keys and values, such that key1+key2+key3 must add up
to less than 80, and filename must be of the length that equals
key1+key2+key3, then maybe you should teach us how to do that in an XML file
that couldn't be done in a text file. Of course, a simple example would
suffice.

> Incidentally, comments aren't lost in XML and each comment
> belongs to an element. Namely, the element in which it appears.

OK, here's the problem with that.

Gobal config file:
<foo>
  <!-- Comment for foo -->
  <key name="bar">value from global config file</key>
  <!-- Another comment for foo -->
</foo>

Local config file:
<foo>
  <!-- Local comment -->
  <key name="bar">overriding bar value</key>
  <!-- local comment the second -->
  <key name="baz">new local baz value</key>
  <!-- Yet another local comment -->
</foo>

Now, in my API, I add the key "pock" to foo, with the value "A winner!", and
I want to put a comment before it. Please show what that call looks like,
and explain how the library decides to keep the local comments and/or the
global config file comments, when I save the local config file back out.

Then reconsider, when the "Comment for foo" actually says "bar is a
parameter that means blah blah blah", and the "Local comment" says "Darren's
local directory".

It sounds like by using XML, you're introducing all kinds of ordering
dependencies in the file, treating the database as an XML structure rather
than something closer to a hashtable, and so you have to decide how to merge
two XML files and output a new one with the same semantics. Difficult to do,
in the case of comments.


-- 
Darren New 
San Diego, CA, USA (PST). Cryptokeys on demand.
** http://home.san.rr.com/dnew/DNResume.html **
** http://images.fbrtech.com/dnew/ **

     My brain needs a "back" button so I can
         remember where I left my coffee mug.



  parent reply	other threads:[~2002-06-13 16:39 UTC|newest]

Thread overview: 83+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-03 11:48 Use of XML for config files Mike and Lynn Card
2002-06-03 17:42 ` Pascal Obry
2002-06-04  6:26 ` Volkert Barr
2002-06-04 12:47   ` SteveD
2002-06-04 13:51     ` Volkert Barr
2002-06-04 19:29   ` Ted Dennison
2002-06-05  7:18     ` Volkert Barr
2002-06-05 10:24       ` Georg Bauhaus
2002-06-05 11:35         ` Preben Randhol
2002-06-05 14:52           ` Georg Bauhaus
2002-06-05 15:22             ` Preben Randhol
2002-06-05 19:11             ` Darren New
2002-06-06 13:38               ` Georg Bauhaus
2002-06-06 15:06                 ` Darren New
2002-06-07 11:28                   ` Georg Bauhaus
2002-06-07 17:10                     ` Darren New
2002-06-06  6:48           ` Volkert Barr
2002-06-06 13:27             ` Georg Bauhaus
2002-06-05 14:41       ` Robert C. Leif
2002-06-09 22:00     ` Stephen Leake
2002-06-10 15:03       ` Ted Dennison
2002-06-10 18:12         ` Stephen Leake
2002-06-12 11:25         ` Georg Bauhaus
2002-06-12 15:33           ` Darren New
2002-06-12 17:53             ` Stephen Leake
2002-06-13 14:18               ` Ted Dennison
2002-06-13 16:36                 ` Stephen Leake
2002-06-14  3:27                   ` Ted Dennison
2002-06-14 15:54                     ` Stephen Leake
2002-06-12 19:18             ` Georg Bauhaus
2002-06-13 13:53             ` Ted Dennison
2002-06-13 15:26               ` Georg Bauhaus
2002-06-13 16:39               ` Darren New [this message]
2002-06-13 17:06                 ` Georg Bauhaus
2002-06-13 17:43                   ` Darren New
2002-06-14 15:56                     ` Georg Bauhaus
2002-06-13 17:54                 ` Georg Bauhaus
2002-06-13 18:31                   ` Darren New
2002-06-14 16:04                     ` Stephen Leake
2002-06-14 16:48                       ` Darren New
2002-06-14 17:03                     ` Georg Bauhaus
2002-06-14 17:22                       ` Darren New
2002-06-18 15:20                         ` Georg Bauhaus
2002-06-18 15:37                           ` Darren New
2002-06-18 18:20                             ` Georg Bauhaus
2002-06-18 19:11                               ` Stephen Leake
2002-06-18 21:47                               ` Darren New
2002-06-19 11:31                                 ` Georg Bauhaus
2002-06-19 15:13                                   ` Stephen Leake
2002-06-19 21:14                                     ` Georg Bauhaus
2002-06-20 14:38                                       ` Stephen Leake
2002-06-20 16:02                                         ` Georg Bauhaus
2002-06-20 20:37                                           ` Stephen Leake
2002-06-21 16:24                                             ` Ted Dennison
2002-06-24 14:11                                               ` Stephen Leake
2002-06-19 16:43                                   ` Darren New
2002-06-19 20:33                                     ` Georg Bauhaus
2002-06-12 17:48           ` Stephen Leake
2002-06-13  7:42             ` Tarjei T. Jensen
2002-06-13 13:53               ` Georg Bauhaus
2002-06-13 14:10               ` Stephen Leake
2002-06-13 16:50                 ` Warren W. Gay VE3WWG
2002-06-13 17:31                   ` Tarjei Tj�stheim Jensen
2002-06-14 16:11                   ` Stephen Leake
2002-06-13 17:28                 ` Tarjei Tj�stheim Jensen
2002-06-19  9:48                   ` Preben Randhol
2002-06-10 14:45     ` Georg Bauhaus
2002-06-09 21:52   ` Stephen Leake
2002-06-10  0:02     ` Preben Randhol
2002-06-10 12:42       ` Stephen Leake
2002-06-10 16:21         ` Pascal Obry
2002-06-12 11:29           ` Georg Bauhaus
  -- strict thread matches above, loose matches on Subject: below --
2002-06-05  7:33 Grein, Christoph
2002-06-05  7:59 ` Volkert Barr
2002-06-05  8:25 Grein, Christoph
2002-06-05  8:39 ` Volkert Barr
2002-06-05  9:31 ` Manuel Collado
2002-06-05 10:01   ` Volkert Barr
2002-06-05 10:02 Grein, Christoph
2002-06-09 22:13 ` Stephen Leake
2002-06-10  1:42   ` Darren New
2002-06-10 12:46     ` Stephen Leake
2002-06-10 15:52       ` Darren New
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox