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:48:02 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed1.cidera.com!Cidera!cyclone.socal.rr.com!cyclone3.kc.rr.com!news3.kc.rr.com!twister.socal.rr.com.POSTED!not-for-mail Message-ID: <3D0A1E5D.3FCC76E5@san.rr.com> From: Darren New X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Use of XML for config files 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> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Fri, 14 Jun 2002 16:48:01 GMT NNTP-Posting-Host: 66.75.151.160 X-Complaints-To: abuse@rr.com X-Trace: twister.socal.rr.com 1024073281 66.75.151.160 (Fri, 14 Jun 2002 09:48:01 PDT) NNTP-Posting-Date: Fri, 14 Jun 2002 09:48:01 PDT Organization: RoadRunner - West Xref: archiver1.google.com comp.lang.ada:25957 Date: 2002-06-14T16:48:01+00:00 List-Id: Stephen Leake wrote: > I agree with this; I'm not sure how to put comments in the API. I would carry a possibly-empty string for each key and section. Allow calls to set or retrieve the comment for a particular key or section. > > 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. I'll look, but I'm kind of busy. :-) > > 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. Fair enough. But if the order isn't important in the DTD, then you can't tell what item the comment refers to, so the order *becomes* important, in the sense that the API has to say where in the list of things output to the file the comments belong. This is the color red This is the brightness 54% What's the DTD for foo? Even if the DTD says the order is unimportant, the order is important. :-) > Ok, I like that. It breaks your earlier example where you had a > comment following a value, but we can't have everything. I don't think that was *my* example, but OK. You could also make it follow the value if it fit. That's the advantage of attaching it to a key instead of to some position in a list. > > 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. But then why use XML if it's just going to make it more complex without giving you any more powerful semantics? > Note that neither of these semantics will support arbitrary placement > of comments by direct editing; the user has to know the rules. Well... the rule is that the comment talks about the next thing. :-) > > 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. You have to certainly at least detect them. And if you're not going to support them, why use XML? -- 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.