[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: Faster saving - new data
From:       dirk.schoenberger () sz-online ! de
Date:       2004-04-16 9:41:29
Message-ID: 59170.217.232.122.177.1082108489.squirrel () webmail ! sz-online ! de
[Download RAW message or body]

> On Friday 16 April 2004 00:43, Dirk Schönberger wrote:
>> I really like the idea with the TagWriter class, even if there are some
>> minor naming problems, like the setAttribute()
>
> Well, initially I had named it addAttribute() (this is what you were
> expecting, right?).
> But then I realized that setAttribute would make it easier to port QDom
> code,
> since it uses setAttribute everywhere already.... Hmm, OTOH this is a
> simple
> search/replace, so I'm ok with addAttribute if that's what you'd prefer.
>

setAttribute and addAttribut sound like they add to a in-memory
representation, like a Map or a List, so that it is not clear when the
attributes are written to the stream.
How about writeAttribute(key, value)?

>> I found a similar class at
>> http://www.jclark.com/xml/xp/api/com.jclark.xml.output.XMLWriter.html
>>
>> Perhaps the public API could be slightly changed to these?
> I tried looking around for a standard API for writing out XML, and didn't
> find one.
> There are tons of XMLWriter classes out there, but all with a different
> API.
> That one has writer.attribute(foo,bar), which really doesn't look
> consistent with
> the Qt/KDE-style API. attribute() looks like a getter, not like a setter.

The XMLWriter I mentioned has methods for writing XML specific elements
like processing instructions and entities, which I missed in your class
(probbably because they are not needed, yet)

And what about namespaces? I think in the OpenOffice file format they are
used. You could work around that, like

writer.beginTag ("xs:paragraph"),

but I don't really like this idea.

Regards
Dirk




>
> --
> David Faure, faure@kde.org, sponsored by Trolltech to work on KDE,
> Konqueror (http://www.konqueror.org), and KOffice
> (http://www.koffice.org).
> _______________________________________________
> koffice-devel mailing list
> koffice-devel@mail.kde.org
> https://mail.kde.org/mailman/listinfo/koffice-devel
>

_______________________________________________
koffice-devel mailing list
koffice-devel@mail.kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic