[PATCH] XML validity of kcfg files

Michael Pyne pynm0001 at comcast.net
Tue Nov 2 02:12:15 GMT 2004

On Sunday 31 October 2004 11:39 am, Waldo Bastian wrote:
> As one of the authors of the DTD it wasn't my intention to enforce a
> certain order. If it is possible to change the current DTD to express that
> the order does not matter, then I suggest to change the DTD in such way.

I've been trying to see how to do this, and it's not hard when duplicate sub 
elements are allowed (such as DIV in HTML can have as many DIV and P children 
as it wants).

But when we limit subelements to a specific cap (usually either 0 or 1 
subelements, but no more, such as a "name" parameter), it gets much harder.  
It can still be done, but the only way I can see to do this (with only a DTD) 
is to simply enumerate all the possibilities.  You can imagine how annoying 
this would become, not to mention how unmaintainable it would be.

It strikes me now that it probably would have been better to make some of 
those zero-or-one sub elements attributes of the element instead when 
possible, but I think it's too late for that, is it not?

For example, instead of <entry><whatsthis>Foo</whatsthis>...</entry>, 
something like <entry whatsthis="foo">...</entry>.

It seems like enough of a pain that I'm not going to spend more time looking 
into it. :(

 - Michael Pyne
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20041101/f85991f0/attachment.sig>

More information about the kde-core-devel mailing list