XML serialization functionality

David Faure faure at kde.org
Wed Mar 15 21:04:53 GMT 2006


On Wednesday 15 March 2006 00:04, Frans Englich wrote:
> On Monday 13 March 2006 21:39, David Faure wrote:
> > On Sunday 12 March 2006 19:02, Frans Englich wrote:
> > > I find that a fairly common thing to do, to produce XML.
> >
> > koffice/lib/store/KoXmlWriter.* does that for koffice. Writing out XML
> > directly into a file (or any other QIODevice), to avoid the QDom memory
> > problem (constructing the complete tree in memory before saving it).
> 
> I looked at the code, and to me SAXSerializer and KoXmlWriter are very similar.

OK.

> The advantage I see with sub-classing 
> QXmlContentHandler(it should be that one instead of QXmlDefaultHandler, on my 
> TODO) is that the class can act as a lego-brick. The serializer class can be 
> plugged directly into arbitrary code that uses SAX, and one can pipe SAX 
> streams by chaining several content handlers.

But the goal is to write XML, not to read it. I don't see the point in doing
this from a SAX handler.

> I will probably think/code on this and post. I really think we should lobby 
> for Qt inclusion since it belongs on that level(IMHO), but more on that later on.

There are enough things that we need that -must- be in Qt. A completely independent
class like this is just fine in kdelibs. After all, we're discussing writing KDE apps here,
not Qt-only apps, right? ;)

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).





More information about the kde-core-devel mailing list