From koffice Sun Oct 15 18:01:01 2000 From: David Faure Date: Sun, 15 Oct 2000 18:01:01 +0000 To: koffice Subject: Re: file format X-MARC-Message: https://marc.info/?l=koffice&m=97163286127204 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=20 >year young student Electrotechnology from Holland, and I am very interes= ted in=20 >KOffice and OpenOffice. I've joined the discussion mailinglist at=20 >openoffice.org, and I hope to do some little coding at that project.=20 >Meanwhile, the discussion on that list was (among other things) about th= e=20 >default file format. There is already consensus on the list that "it sho= uld be=20 >XML", but there is not yet any consensus about what to do with binary st= uff=20 >like images. (Some suggested a package, like a tar or jar file that cont= ain the=20 >XML data, others suggested MIME-encoding of the binary object inside the= XML=20 >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 s= tore >the binary objects and the XML-files, but the faq still leaves me a few=20 >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 momen= t than a library handling bzip2). > * When/how is the compression applied (on the individual XML-files o= nly, 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" wil= l 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-f= iles > (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 c= hoosen > as package-format? It makes it very easy to open, for an "advanced user". For instance, to r= eplace an image without having to launch the application, or for developers to d= ebug the loading/saving code, by looking into the tar file. Those are the adva= ntages 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 wa= s quite simple to do. > * Is there anything special about the tar-package (eg: does it have so= me sort=20 > 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 i= t from me). > * Are there any tools provided with KOffice to extract the XML-files f= rom 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-fil= e? >=09* If not, why? KOffice used to do that when the document contained no child and no image= =2E But we removed that, because we thought it would make it harder for other= s to write filters that can read KOffice files (it would mean the filters h= ave to guess what type of file it is). But this means, KOffice can _read_ "pure" XML files just fine, for backwa= rds compatibility. > * If so, how are the binary objects encoded and is there anything sp= ecial > about the generated XML-file (like an index at the beginning, or a= ll > binary objects at the end)? No, just normal tar.gz file > Is it also possible to update the text in the >=09 XML-file, without saving the (large) binairy objects again (the >=09 partial-update)? At the moment, not yet, but there's nothing that prevents implementing it= =2E (Just like tar is able to do it). > * Are there mailinglist archives that I (and others of openoffice) cou= ld read, > about this (and other) subjects? Sure, see on http://lists.kde.org/ for the lists koffice@kde.org and koff= ice-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 K= Office) >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. --=20 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