[PATCH] XML validity of kcfg files

Benjamin Meyer ben at meyerhome.net
Sat Nov 20 19:11:48 GMT 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wednesday 03 November 2004 1:19 am, Frans Englich wrote:
> On Wednesday 03 November 2004 02:22, Cornelius Schumacher wrote:
> > On Wednesday 03 November 2004 01:24, Frans Englich wrote:
> > > Anyway, attached is an XML Schema version for the KConfigXT format,
> > > most of it is written but could use some polishing, and tighter
> > > validation can also be done. If someone wants to do anything with it,
> > > or in the future will do fancy stuff, it is here in the archives(I'll
> > > not push it).
> >
> > Looks nice, but it failed to validate korganizer.kcfg for me. After
> > adding a default namespace declaration to the kcfg file xmllint fails
> > with an "Element kcfg content check failed" error. Is this due to the
> > ordering constraints? Is there a better tool for validating XML files
> > against XML schemas?
>
> We can't blame xmllint for barfing, but it sure is lousy at it :) It
> doesn't tell what was wrong, only a line number and the element(I filed a
> bug report on libxml2). It barfed because the kcfg files was better at
> following the format than the Schema :) This is now fixed, and a handful of
> random kcfg files validates(including korganizer.kcfg AFAICT), but it
> surely still has its quirks.
>
> The Schema can be a pretty good way to "encourage" practices. For example,
> entries should have the label element, and by making it mandatory(I
> haven't) people will hopefully take notice and write those descriptions(and
> Benjamin's test scripts makes the bugs visible). Since it's voluntary to
> switch to the Schema, this is now the chance to tighten the format without
> breaking backwards compatibility(if one wants to do that).
>
> It's also possible to tighten validation much more, just one takes the time
> to think about it(for example, elements containing code, can be tested with
> a regexp such that it doesn't end with a semicolon, and hence save people
> from scratching their heads when the build fails).
>
> I committed it, such that it is under revision control:
>
> CVS commit by englich:
> The XML Schema version of the DTD for the KConfigXT format. When it is
> stable we can place a copy in www/
>
> The documentation(in the file) has an example of how a proper XML document
> declaration should look like. Then, one can validate the KConfigXT file
> with `xmllint --noout --schema kdelibs/kdecore/kconfig_compiler/kcfg.xsd
> foo.kcfg`.
>
>   A            kcfg.xsd   1.1
>
>
> Cheers,
>
> 		Frans

Ok, been converting some kcfg files to see what is missing.

Some items including min, max, parameter seem to be in a lot of kcfg files, 
but aren't in the xsd.

I have run a new report to quickly find them all:

http://www.icefox.net/kde/tests/report.html

- -Benjamin Meyer 



- -- 
aka icefox
Public Key: http://www.icefox.net/public_key.asc
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQFBn5b01rZ3LTw38vIRAoGcAJ4imGuSAFWl//X6l/f/bvpv0xk0lQCeLJUO
25B97540RXbQ84HiPPZFWbc=
=Da4M
-----END PGP SIGNATURE-----




More information about the kde-core-devel mailing list