From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a26758eec3c2e1ad X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-06-14 09:13:34 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!hammer.uoregon.edu!skates!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: Use of XML for config files Date: 14 Jun 2002 12:04:44 -0400 Organization: NASA Goddard Space Flight Center (skates.gsfc.nasa.gov) Message-ID: References: <3CFC5DB2.A21DCF61@cs.tu-berlin.de> <4519e058.0206041129.5b250124@posting.google.com> <4519e058.0206100702.5a4b431a@posting.google.com> <3D0769F7.68F5BD9C@san.rr.com> <4519e058.0206130553.3ee195f1@posting.google.com> <3D08CAF0.846AA176@san.rr.com> <3D08E539.343A42BF@san.rr.com> NNTP-Posting-Host: anarres.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: skates.gsfc.nasa.gov 1024071156 19225 128.183.220.71 (14 Jun 2002 16:12:36 GMT) X-Complaints-To: usenet@news.gsfc.nasa.gov NNTP-Posting-Date: 14 Jun 2002 16:12:36 GMT User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.ada:25951 Date: 2002-06-14T16:12:36+00:00 List-Id: Darren New writes: > Georg Bauhaus wrote: > > Uhm, you have named the things to consider for a policy. Have I missed > > something? Merging, overriding, combining, how should that appear in > > an API independent of any file format? I agree with this; I'm not sure how to put comments in the API. > Well, that's the question. I think it's something much easier to > answer for INI files than XML files. Ok, could you provide an example implementation? I'll be posting a Java properties style after the weekend, without comments. Maybe you could start with that. > > : It sounds like by using XML, you're introducing all kinds of > > : ordering dependencies in the file, > > > > No that is introduced by using comments as data and has nothing to > > do with XML. > > Uh, sure it does. The order of tags in XML is quite explicitly important. Well, the order of data tag 'foo' vs comment tag 'bar' is not important, unless the DTD says it is. > Difficult to do if you use XML, because XML has a particular semantics for > comments. But we don't _have_ to use that for Config_File comments. I think Config_File comments as attributes makes the associations easier to keep straight. But it would probably be somewhat confusing to read :(. > Easy to do for INI because you get to make up yourself what those > semantics are. In an INI format, I could say "the comment always > attaches to whatever non-comment object comes next." So you'd have > > # This section is for colors > [Colors] > # The background color > bg=23 > # The forground color > fg=87 > > Here, if I used the API to delete "fg" and wrote it back out, it's obvious > what happens to the comment. Ok, I like that. It breaks your earlier example where you had a comment following a value, but we can't have everything. > I'm just saying that I think the semantics of the kind of thing an INI file > would have to deal with in the API are pretty darn straightforward. I bet we could come up with an implementation of the same semantics for XML. Note that neither of these semantics will support arbitrary placement of comments by direct editing; the user has to know the rules. > The kinds of things an XML-based file would have to deal with are > far more complicated. But we don't have to support them all. -- -- Stephe