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

List:       koffice
Subject:    Re: file format
From:       David Faure <david () mandrakesoft ! com>
Date:       2000-10-15 18:01:01
[Download RAW message or body]

On Samedi 14 Octobre 2000 22:14, admar@luon.net wrote :
>Hello,
>
>I will first give a slight introduction of my self: I'm Admar Schoonen, a 20 
>year young student Electrotechnology from Holland, and I am very interested in 
>KOffice and OpenOffice. I've joined the discussion mailinglist at 
>openoffice.org, and I hope to do some little coding at that project. 
>Meanwhile, the discussion on that list was (among other things) about the 
>default file format. There is already consensus on the list that "it should be 
>XML", but there is not yet any consensus about what to do with binary stuff 
>like images. (Some suggested a package, like a tar or jar file that contain the 
>XML data, others suggested MIME-encoding of the binary object inside the XML 
>file.) I remembered that KOffice already uses XML as default file format

That is correct.

>It's said there (sections 5.3/5.4), that KOffice uses a tar-package to store
>the binary objects and the XML-files, but the faq still leaves me a few 
>questions:
>  * Is there any kind of compression of the package?
>    * If so, what kind of compression (gzip, bzip2, ...)?

It uses gzip.

(The technical reason is that libgzip is much more available at the moment
than a library handling bzip2).

>    * When/how is the compression applied (on the individual XML-files only, on
>      all files, before or after creating the tar-ball)?

On the whole tarball. Just like a "tar.gz" file.
This makes it very easy to open a KOffice file : "tar xvfz blah.kwd"  will extract
all the components (XML files, images, etc.) in one go.

>  * Is there any kind of security in the package?
>    * If so, what kind of security?
>    * When/how is security applied (inside several sections of the XML-files
>     (per-section coding), on the individual files, before or after the
>     tar-ball)?

There is no security (yet?).

>  * What were the main reasons to choose for a package, and why is tar choosen
>    as package-format?

It makes it very easy to open, for an "advanced user". For instance, to replace
an image without having to launch the application, or for developers to debug
the loading/saving code, by looking into the tar file. Those are the advantages
of choosing a purely standard archive format.

In terms of implementation, KDE has a class named KTar that takes care of
both the tarring and the gzipping (on the fly, using libgzip), so this was quite simple to do.

>  * Is there anything special about the tar-package (eg: does it have some sort 
>    of index-file, like jar does)?
No. We know what the files are from the main document, "maindoc.xml",
which refers to the embedded objects and images. And this is recursive
(you can embed an object that itself has children and images).
For more details on this, see the file koffice/lib/store/DESIGN (or ask it from me).

>  * Are there any tools provided with KOffice to extract the XML-files from the
>    package?
No, tar does the job just fine :-)

>  * Is there an option in KOffice to not save as a package, but to save to a
>    "pure" XML-file with the (encoded) binary objects inside the XML-file?
>	* If not, why?

KOffice used to do that when the document contained no child and no image.
But we removed that, because we thought it would make it harder for others
to write filters that can read KOffice files (it would mean the filters have to guess
what type of file it is).
But this means, KOffice can _read_ "pure" XML files just fine, for backwards compatibility.

>    * If so, how are the binary objects encoded and is there anything special
>      about the generated XML-file (like an index at the beginning, or all
>      binary objects at the end)?
No, just normal tar.gz file

> Is it also possible to update the text in the
>	  XML-file, without saving the (large) binairy objects again (the
>	  partial-update)?
At the moment, not yet, but there's nothing that prevents implementing it.
(Just like tar is able to do it).

>  * Are there mailinglist archives that I (and others of openoffice) could read,
>    about this (and other) subjects?

Sure, see on http://lists.kde.org/ for the lists koffice@kde.org and koffice-devel@kde.org

>The last question: do you mind if your reply gets posted to
>discuss@openoffice.org?

Not at all ! Please do !

>Thank you for your reply, and I'm hoping both projects (OpenOffice and KOffice)
>can learn from each other (and perhaps share code).

So do we ! Thanks a lot for this first step.

>And if this address (koffice@kde.org) is a mailing list, please cc to me, since
>I'm not on the list. Thank you.

Done.

-- 
David FAURE, david@mandrakesoft.com, faure@kde.org
http://www.mandrakesoft.com/~david/, http://www.konqueror.org/
KDE, Making The Future of Computing Available Today
See http://www.kde.org/kde1-and-kde2.html for how to set up KDE 2

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

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