[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Canonical pushes upstart into user session - systemd developer complains

On 2012-12-01 10:16:54 +0100, Wouter Verhelst wrote:
> On Fri, Nov 30, 2012 at 02:18:04AM +0100, Vincent Lefevre wrote:
> > At least for Perl, I can't see anything related to validation.
> That's because validating an ini file is trivially easy:
> the line is a comment line, which must start with a # after optional
> whitespace,
> or it is a section header, where all data must be surrounded by [],
> or it is a key-value pair, where the key must be one word and be
> separated by the value by a =
> or it is invalid.

No, that's not sufficient. You may want relations between key-value
pair. For instance, if you have a line with a key "foo", then a line
with a key "bar" must also exist. Or a line with a key "number" must
have a value that is a number (more generally matching some regexp).

> There, validation.
> To validate an XML file, much more is involved, including checks of
> nested tags and escaped characters.

That's well-formedness (which also corresponds to validation with
an empty schema).

> > BTW, how do you do nested blocks in .ini files?
> You can't, and that's a feature. Instead, you have keys where the value
> is the name of another section (or possibly another ini file) containing
> the "nested" data.

So, there is a good reason to use XML (or some other format with
similar features) instead of ini: if one needs nested blocks or
may need them in the future.

Vincent Lefèvre <vincent@vinc17.net> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

Reply to: