XML serialization functionality
frans.englich at telia.com
Wed Mar 29 15:48:36 BST 2006
On Tuesday 28 March 2006 22:16, David Faure wrote:
> On Wednesday 29 March 2006 00:05, Frans Englich wrote:
> > Why is indentation needed?
> > With my limited knowledge, the only one I see who would gain from having
> > the document indented is those who decides to extract and open the XML
> > documents(and hack it).
> > Indentation seems to me like a feature that has,
> > relatively speaking, a very small user base, at the cost of CPU and
> > storage usage of all users.
> Given the zipping, I have yet to see proof about any relevant storage
> difference :) The CPU difference can't be too big either, but ok, it's not
Yes, I also think the storage impact is close to neglectible since most
compression algorithms are very effective on whitespace. Perhaps there is a
relevant CPU-cost in the serialization of "very" large documents.
> However we have to rework loading before saving is any kind of performance
> issue compared to our current QDom-based loading :)
KDOM has in general a lot of efficient XML code. As it is now NodeImpl objects
carries a pointer to a RenderObject which is a real pity and ugly
engineering-wise, since it forces memory consumption on people even if they
don't get anything in return. KHTML's particular needs should have been
implemented with sub-classing. But it would probably anyway be more efficient
> Overall I'm rather
> happy with the saving performance when using KoXmlWriter.
> > With reservations, it sounds like it is a feature that
> > should be skipped, and thus make KOffice even more lighter and
> > user-oriented. Those who want to hack the format can easily run the file
> > through an XML indenter or open it in an XML editor, imho.
> That is true, and indeed I now got used to that when debugging xml files
> (see scripts on www/areas/koffice/developer/fileformat - in svn while
> koffice.org is unreachable). But I know that the first time I saw a
> completely unindented xml file from OOo I thought "yuck" ;-)
> To conclude, I agree. I think we can live with unindented xml files where
> performance matters.
My primary interest is perhaps not performance, but more the general principle
of that GUIs/software is designed and targetted at users, as opposed to us
hackers and XML geeks :)
But this is of course also relevant for the discussion of what is needed and
should go into kdelibs. As it is now, I won't write an indenter class for
kdelibs, because its existence can't be justified: there's no demand.
More information about the kde-core-devel