XML serialization functionality

Thiago Macieira thiago at kde.org
Mon Mar 20 09:16:16 GMT 2006


Frans Englich wrote:
>My idea is to create an "XMLIndenter" class(which KOffice seems to need)
>depending on feedback. XMLIndenter would sub-class QXmlContentHandler,
> have a content handler("QXmlContentHandler *contentHandler() const",
> etc) and a property for the indentation string("void
> setIndentString(const QString &i)", etc). It would re-implement all the
> handler functions and before/after sending forwarding to its
> contentHandler(), it would push indentation via characters().

Huh? Indentation?

Unless you consider the \n too much, I recommend adding them after each 
and every tag. Then you add level * n spaces, where level is your nesting 
level and "n" is a user-defined value of the number of spaces per level. 
No indentation would mean n = 0.

That's how QDomNode::save works.
-- 
Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
  thiago.macieira (AT) trolltech.com     Trolltech AS
    GPG: 0x6EF45358                   |  Sandakerveien 116,
    E067 918B B660 DBD1 105C          |  NO-0402
    966C 33F5 F005 6EF4 5358          |  Oslo, Norway
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20060320/373ae7a6/attachment.sig>


More information about the kde-core-devel mailing list