comp.lang.ada
 help / color / mirror / Atom feed
From: Darren New <dnew@san.rr.com>
Subject: Re: Use of XML for config files
Date: Fri, 14 Jun 2002 17:22:51 GMT
Date: 2002-06-14T17:22:51+00:00	[thread overview]
Message-ID: <3D0A2686.785D1BAC@san.rr.com> (raw)
In-Reply-To: aed7ll$p83$1@a1-hrz.uni-duisburg.de

Georg Bauhaus wrote:
> 
> Darren New <dnew@san.rr.com> wrote:
> : the order of tags in XML is quite explicitly important.
> 
> Unless the DTD says it doesn't matter (in repeated alternatives).

It still matters. 
  <body> <h1> First </h1> <h1> Second </h1> </body>
  <body> <h1> Second </h1> <h1> First </h1> </body>

Contrast with
[Colors]
red=0xFF0000
blue=0x0000FF

[Colors]
blue=0x0000FF
red=0xFF0000

> : Difficult to do if you use XML, because XML has a particular semantics for
> : comments.
> 
> None that I know of. You can put pretty much anything in a comment other
> than --.

That's the syntax of comments. If you're saying that comments attach to
whatever object they're nested in, then that's different from comments
attach to whatever comes next.

Note that the goal would be to preserve comments correctly (for some value
of "correct") in the event that the program edits the config file, inserting
deleteing and merging items. 

> : "the comment always attaches to
> : whatever non-comment object comes next."
> 
> Why shouldn't that be possible with XML?

1) It would be, but you said comments should attach to their container.

2) Comments can be followed by more comments. Do comments attach to
comments?

3) What about comments at the end of a structure?

> This isn't what I would want it to do, it should (if necessary) help
> overcome the limitations of sectioned key-value settings.

Right. You're agreeing with me. What do you want it to do? Don't tell me "it
eliminates the problems with your format."  Tell me what it does
*positively*.  What problems does it eliminate and how, that makes it worth
the extra syntax?

> : Perhaps offering an idea of the API you're envisioning
> : would help it move forward.
> 
> Suppose an INI-like API would cover sections and key-value settings
> in a section, using any syntax. Then in your example you might have
> 
> [tools]
> brush=round airbrush green
> ...
> 
> (Maybe you would do it differently?)
> 
> This leaves some room for parsing, in that you would have to specify
> 1st is shape, 2nd is type, 3rd is color.

or
brush.type=airbrush
brush.shape=round
brush.color=green

> whereas
> <tools>
>   <brush type="airbrush" shape="circle" color="green"/>
>   ...
> </tools>
> 
> makes this unnecessary. Much like named parameters in Ada.

OK. So we add a little more to the ini format. We still don't get into
matched-tags hell etc.
 
> In addition, as you can see in the example,
> I am thinking of an application which (perhaps unlike
> other applications) might profit from tags that do not just
> mimic INI-style "key" and "value". This makes the configuration
> look like application specific, but why not? The software for
> fiddling with the configuration data doesn't have to be, except
> for the necessary parameterizations of subprograms,
> say (for example if you want the attribute list of the current
> tool, which is a String = Name_Of(Brush)).

Maybe I'm not seeing any big difference between "XML parser" and "Config
file API" here. If someone wants a config file that complex, why not just
use one of the existing XML parsers? 

-- 
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.



  reply	other threads:[~2002-06-14 17:22 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
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 [this message]
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