XML option parser for mcs

Guido Draheim guidod-2002- at gmx.de
Sun Dec 29 14:25:38 CET 2002


Olivier Fourdan wrote:
> Hi Guido,
> 
> 
>>This format makes it hard to be checked with an external
>>parser being able to validate an xml file with a DTD. At
>>minimum, it should be name="option" along with their
>>int="3" and string="an option" and color="255,255,0". The
>>type indicator may be passed along for convenience to your
>>reader function to know as to which attribute to look for.
> 
> 
> GMarkup doesn't do any DTD validation anyway, and "semantically", I'm
> not sure this syntax makes sense since an option is either a string, an
> int or a color, but not all three.
> 
> As for validation, the syntax is so simple that I hardly see the need
> for the use of a validator :)
> 

I know. The point is: external tools. Think of config file
format changes later. Think of third party config gui.
Think of debuggin work, with extra routines that do not
need to interpret into depth. The real success of xml is out
of the vast number of tools already being available - if you
just want to have name=value then it might be better to
just stick to ini-style format which can be easily parsed
as well - and gscanner helps a lot in here. Well, personally,
I'd advise to use the power of xml... and I did just want
to hint about how to make that config format to be better
suited for the xml world...




More information about the Xfce4-dev mailing list