Mimetype names (Re: mimetypes for zipped files)

Marc Mutz Marc.Mutz at uni-bielefeld.de
Wed Apr 10 15:37:01 BST 2002


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wednesday 10 April 2002 12:51, David Faure wrote:
<snip>
> Some questions: is it mandatory to have the year in it? If we have the
> version number - the one of the DTD rather than the one of the application,
> in case the DTD doesn't change between two releases - do we really need the
> year?

No, but it's commonly used (esp. by W3C). Is there a problem with including 
it?

> (For the number, I used 1.1.1 at first, but I'm going to use 1.1 and
> later 1.2 instead)

Yes, that sounds reasonable. I don't think a bugfix release will change the 
DTD.

> > <!DOCTYPE document-info PUBLIC "-KDE//DTD document-info 1.1.1//EN"

There was a typo: it should read -//KDE, not -KDE.

> The "document-info" in the public ID is the name of the root element,
> right?

No. The first "document-info" is the name of the root element (otherwise it's 
invalid XML). The second can be anything. You can just as well use a more 
reading-friendly capitalization.

> What's this public ID used for?

Accoring to the spec, "An XML processor attempting to retrieve the entity's 
content may use the public identifier to try to generate an alternative URI 
reference."
Ie.: It's an alternative identifier.
Other people's import filters can recognize the document type and version with 
it and do smart guesses even if we change the location of the DTD and 
therefore the SystemLiteral.

> >   "http://www.kde.org/DTD/2001/koffice/document-info-1.1.1.dtd">
>
> System ID.

Yes and no. This is the SystemLiteral of the PUBLIC ID. The corresponding 
production reads:
[75] ExternalID ::= 'SYSTEM' S SystemLiteral
                    | 'PUBLIC' S PubidLiteral S SystemLiteral

> Ok. I managed to used QDom to add all those fields, will commit
> 2 helper methods to KoDocument soon.
> I wrote a DTD for document-info stuff too.
>
> > <document-info
> > xmlns="http://www..kde.org/DTD/2001/koffice/document-info">
<snip>
> Is this just like a namespace, whose value doesn't
> really matter in fact - but people use parts of a URL in order to ensure
> its uniqueness?

Exactly.

<snip>
> > Well, that's what the version information in the DOCTYPE is actually for,
> > no?
>
> Oh, ok. Then there's no problem. I thought you said it was one.

Yes, it _was_ one. Because the DOCTYPE does not yet conatin any trace of 
version information:
<!DOCTYPE document-info>

> Thanks for the above explanations. The XML generated by KOffice will be
> more compliant in the next release...
>
> Since you seem to care about such compliance, why not do the same to the
> DTD for the XMLGUI? That's a _lot_ of .rc files to change though.

Sure. Tell me whom to contact to put the DTD on www.kde.org and I'll start.

It would help if the .rc files are sent through "xmllint --valid" on "make 
all", so that developers get errors. Currently, they seem to be silently 
ignored.

> > Yes, and only because we are Open Source, we are allowed to ignore and
> > break the standards, yes? Are we Microsoft or what?
>
> Ok, you misunderstood my position on this issue. But I give up trying to
> explain it.
>
> > I think IETF will have nothing against registering this as app/tar if
> > someone writes a RFC about it.
>
> Sure - my point is that that "someone" hasn't stepped up yet. Please
> register the 100+ mimetypes used in the opensource world (and not only),
> that nobody has registered yet, then rename all the mimetypes in KDE, Gnome
> and Apache, then take care of the migration. I won't stop you from doing
> it, on the contrary, I simply have other priorities.

Ok, you misunderstood me, too. I never suggested that the KDE project fixed 
unrelated mimetypes. I just wanted to achieve that _new_ KDE apps' and also 
important existing mimetypes not get the x- prefix automatically:
app/x-povmodeler
    x-krita
    x-krayon
<other koffice types>
   x-pkcs7-signature (ok, that was I myself, but I plea not guilty, since that 
                      was copied from a mail I got.)
text/x-xslt (this is actually app/xslt+xml as per rfc3023 :-( )
These are mimetypes that were recently added to kdelibs/mimetypes for KDE apps 
or mimetypes that are already registered and thus have a non-x-name.

> > > Except that a KWord document was a tar.gz, and is very soon going to be
> > > a zip file. It's not a raw XML file. Are you sure the +xml applies?
> >
> > It applies for the maindoc.xml file, not for the tar/zip archive, yes.
> > The latter should probably simply be application/vnd.kde.koffice.
>
> I don't really see why we need a mimetype for the inner components of a
> koffice document.

I thought this was necessary since the xml files noted the mimetype as 
attribute in the root element of the maindoc.xml file.

> What we do need most, is a mimetype for the complete
> (tar/zip) document, and that one has to be application-specific, otherwise
> we don't know which app to launch. Hence it must be vnc.kde.kword (or
> vnc.koffice.kword), not just "koffice".

OK. The old format was tar.gz only, right? No tar.bz2 possible?
Is it already clear what the magic numberss will be for the zip-based format?
Will KOffice 1.2 only write zip files or also tar.gz?

I ask this because if the tar.gz format will see significant use in the 
future, we need to add an optional parameter "envelope=targz|zip", defaulting 
to zip. Else, we could say that app/vnd.kde.kword etc only apply to KOffice 
files >= 1.2 (ie. with zip envelope).

Marc

- -- 
Marc Mutz <mutz at kde.org>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE8tE4c3oWD+L2/6DgRAjKAAJ0Sp+9QxeFJawMNjsQC8xXKqB0ubACgpBtK
PWpN4oIrD0r629aPSrSRreE=
=o7pa
-----END PGP SIGNATURE-----





More information about the kde-core-devel mailing list