Changes

Jump to: navigation, search

Generate XML

100 bytes added, 03:43, 7 July 2007
m
Why doesn't GRAMPS just use a .gz extension?
GRAMPS uses the [http://freedesktop.org/wiki/Software/shared-mime-info Shared Mime System] defined by [http://freedesktop.org Free Desktop] project, and used by all major desktops, including KDE and GNOME. GRAMPS relies on the MIME type identified by the Shared Mime System to determine the file type of the file.
The Share Mime System allows you to identify a file's type by either using a file extension or by looking at the contents of a small section of the file. The first problem is, usually the filename or extension pattern has the higher priority compared to the contents: if the file is named <code>something.jpg</code> then it is likely to be JPEG image, not text. The second problem is, So if we looked at the contents, we would not be able to tell the difference between a gzip'd GRAMPS XML file or any other gzip'd filehad added <code>. If we looked at uncompressed datagz<code> extension to the name, we the Shared Mime system would not be able to tell us that the difference between a GRAMPS XML file and other XML files. For these reasons, we must rely on 's type is <code>application/x-gzip</code> instead of the expected <code>.application/x-gramps-xml</code> extension. Unfortunately, it cannot tell us that it is a gzip'd GRAMPS XML file.
If The second problem is, if we looked at the contents, we would not be able to tell the difference between a gzip'd GRAMPS XML file had added or any other gzip'd file.gz extension If we looked at uncompressed data, we would not be able to tell the namedifference between a GRAMPS XML file and other XML files. So again, the Shared Mime system would could not tell us that the file's type it is <code>application/x-a gzip</code> instead of 'd GRAMPS XML file. For these reasons, we must rely on the expected <code>application/x-.gramps-xml</code>extension. Unfortunately, it cannot tell us that it is a <code>gzipIf we don'd</code> GRAMPS XML file. Sot, we would not be able to tell if this was a valid file. Even worse, the mime type of <code>application/x-gzip</code> would be associated with another application (such as File Roller or Ark) instead of GRAMPS.
GRAMPS is not unique in this problem. For example, the OpenDocument format used by OpenOffice, KWord and AbiWord is actually a collection of files in a <tt>zip</tt> archive. If you run <tt>unzip</tt> on a OpenDocument file, you will see something like:

Navigation menu