Imported Upstream version 1.0
[platform/upstream/shared-mime-info.git] / shared-mime-info-spec.xml
1 <?xml version="1.0" standalone="no"?>
2 <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
4   <!ENTITY updated "8 October 2010">
5   <!ENTITY version "0.20">
6 ]>
7 <article id="index">
8
9 <articleinfo>
10         <authorgroup>
11                 <corpauthor>
12                         <ulink url="http://www.freedesktop.org">
13                         X Desktop Group
14                         </ulink>
15                 </corpauthor>
16                 <author>
17                         <firstname>Thomas</firstname>
18                         <surname>Leonard</surname>
19                         <affiliation>
20                                 <address><email>tal197 at users.sf.net</email></address>
21                         </affiliation>
22                 </author>
23         </authorgroup>
24
25         <title>Shared MIME-info Database</title>
26         <date>&updated;</date>
27 </articleinfo>
28
29 <sect1>
30         <title>Introduction</title>
31         <sect2>
32                 <title>Version</title>
33                 <para>
34 This is version &version; of the Shared MIME-info Database specification, last updated &updated;.</para>
35         </sect2>
36         <sect2>
37                 <title>What is this spec?</title>
38                 <para>
39 Many programs and desktops use the MIME system<citation>MIME</citation>
40 to represent the types of files. Frequently, it is necessary to work out the
41 correct MIME type for a file. This is generally done by examining the file's
42 name or contents, and looking up the correct MIME type in a database.
43                 </para>
44                 <para>
45 It is also useful to store information about each type, such as a textual
46 description of it, or a list of applications that can be used to view or edit
47 files of that type.
48                 </para>
49                 <para>
50 For interoperability, it is useful for different programs to use the same
51 database so that different programs agree on the type of a file and
52 information is not duplicated. It is also helpful for application authors to
53 only have to install new information in one place.
54                 </para>
55                 <para>
56 This specification attempts to unify the MIME database systems currently in
57 use by GNOME<citation>GNOME</citation>, KDE<citation>KDE</citation> and
58 ROX<citation>ROX</citation>, and provide room for future extensibility.
59                 </para>
60                 <para>
61 The MIME database does NOT store user preferences (such as a user's preferred
62 application for handling files of a particular type). It may be used to store
63 static information, such as that files of a certain type may be viewed with
64 a particular application.
65                 </para>
66         </sect2>
67         <sect2>
68                 <title>Language used in this specification</title>
69                 <para>
70 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD",
71 "SHOULD NOT", "RECOMMENDED",  "MAY", and "OPTIONAL" in this document are to be
72 interpreted as described in RFC 2119<citation>RFC-2119</citation>.
73                 </para>
74         </sect2>
75 </sect1>
76
77 <sect1>
78         <title>Unified system</title>
79         <para>
80 In discussions about the previous systems used by GNOME, KDE and ROX (see the
81 "History and related systems" document), it was clear that the differences
82 between the databases were simply a result of them being separate, and not due
83 to any fundamental disagreements between developers. Everyone is keen to see
84 them merged.
85         </para>
86         <para>
87 This specification proposes:
88
89                 <itemizedlist>
90                         <listitem><para>
91 A standard way for applications to install new MIME related information.
92                         </para></listitem>
93                         <listitem><para>
94 A standard way of getting the MIME type for a file.
95                         </para></listitem>
96                         <listitem><para>
97 A standard way of getting information about a MIME type.
98                         </para></listitem>
99                         <listitem><para>
100 Standard locations for all the files, and methods of resolving conflicts.
101                         </para></listitem>
102                 </itemizedlist>
103 Further, the existing databases have been merged into a single package
104 <citation>SharedMIME</citation>.
105         </para>
106         <sect2 id="s2_layout">
107                 <title>Directory layout</title>
108                 <para>
109 There are two important requirements for the way the MIME database is stored:
110                         <itemizedlist>
111                                 <listitem><para>
112 Applications must be able to extend the database in any way when they are installed,
113 to add both new rules for determining type, and new information about specific types.
114                                 </para></listitem>
115                                 <listitem><para>
116 It must be possible to install applications in /usr, /usr/local and the user's home directory
117 (in the normal Unix way) and have the MIME information used.
118                                 </para></listitem>
119                         </itemizedlist>
120                 </para>
121                 <para>
122 This specification uses the XDG Base Directory Specification<citation>BaseDir</citation> to
123 define the prefixes below which the database is stored.
124 In the rest of this document, paths shown with the prefix
125 <filename>&lt;MIME&gt;</filename> indicate the files should be loaded from
126 the <filename>mime</filename> subdirectory of every directory in
127 <envar>XDG_DATA_HOME</envar>:<envar>XDG_DATA_DIRS</envar>.
128                 </para>
129                 <para>
130 For example, when using the default paths, <quote>Load all the
131 <filename>&lt;MIME&gt;/text/html.xml</filename> files</quote> means to
132 load <filename>/usr/share/mime/text/html.xml</filename>,
133 <filename>/usr/local/share/mime/text/html.xml</filename>, and
134 <filename>~/.local/share/mime/text/html.xml</filename> (if they exist, and in this order).
135 Information found in a directory is added to the information found in previous
136 directories, except when <userinput>glob-deleteall</userinput> or <userinput>magic-deleteall</userinput>
137 is used to overwrite parts of a mimetype definition.
138                 </para>
139                 <para>
140 Each application that wishes to contribute to the MIME database will install a
141 single XML file, named after the application, into one of the three
142 <filename>&lt;MIME&gt;/packages/</filename> directories (depending on where the user requested
143 the application be installed). After installing, uninstalling or modifying this
144 file, the application MUST run the <command>update-mime-database</command> command,
145 which is provided by the freedesktop.org shared database<citation>SharedMIME</citation>.
146                 </para>
147                 <para>
148 <command>update-mime-database</command> is passed the <filename>mime</filename>
149 directory containing the <filename>packages</filename> subdirectory which was
150 modified as its only argument. It scans all the XML files in the <filename>packages</filename>
151 subdirectory, combines the information in them, and creates a number of output files.
152                 </para>
153                 <para>
154 Where the information from these files is conflicting, information from directories
155 lower in the list takes precedence.
156 Any file named <filename>Override.xml</filename> takes precedence over all other files in
157 the same <filename>packages</filename> directory. This can be used by
158 tools which let the user edit the database to ensure that the user's
159 changes take effect.
160                 </para>
161                 <para>
162 The files created by <command>update-mime-database</command> are:
163                         <itemizedlist>
164                                 <listitem><para>
165 <filename>&lt;MIME&gt;/globs</filename> (contains a mapping from names to MIME types) [deprecated for globs2]
166                                 </para></listitem>
167                                 <listitem><para>
168 <filename>&lt;MIME&gt;/globs2</filename> (contains a mapping from names to MIME types and glob weight)
169                                 </para></listitem>
170                                 <listitem><para>
171 <filename>&lt;MIME&gt;/magic</filename> (contains a mapping from file contents to MIME types)
172                                 </para></listitem>
173                                 <listitem><para>
174 <filename>&lt;MIME&gt;/subclasses</filename> (contains a mapping from MIME types to types they inherit from)
175                                 </para></listitem>
176                                 <listitem><para>
177 <filename>&lt;MIME&gt;/aliases</filename> (contains a mapping from aliases to MIME types)
178                                 </para></listitem>
179                                 <listitem><para>
180 <filename>&lt;MIME&gt;/icons</filename> (contains a mapping from MIME types to icons)
181                                 </para></listitem>
182                                 <listitem><para>
183 <filename>&lt;MIME&gt;/generic-icons</filename> (contains a mapping from MIME types to generic icons)
184                                 </para></listitem>
185                                 <listitem><para>
186 <filename>&lt;MIME&gt;/XMLnamespaces</filename> (contains a mapping from XML
187 (namespaceURI, localName) pairs to MIME types)
188                                 </para></listitem>
189                                 <listitem><para>
190 <filename>&lt;MIME&gt;/MEDIA/SUBTYPE.xml</filename> (one file for each MIME
191 type, giving details about the type, including comment, icon and generic-icon)
192                                 </para></listitem>
193                                 <listitem><para>
194 <filename>&lt;MIME&gt;/mime.cache</filename> (contains the same information as the <filename>globs2</filename>,
195 <filename>magic</filename>, <filename>subclasses</filename>, <filename>aliases</filename>,
196 <filename>icons</filename>, <filename>generic-icons</filename> and <filename>XMLnamespaces</filename> files,
197 in a binary, mmappable format)
198                                 </para></listitem>
199                         </itemizedlist>
200 The format of these generated files and the source files in <filename>packages</filename>
201 are explained in the following sections. This step serves several purposes. First, it allows
202 applications to quickly get the data they need without parsing all the source XML files (the
203 base package alone is over 700K). Second, it allows the database to be used for other
204 purposes (such as creating the <filename>/etc/mime.types</filename> file if
205 desired). Third, it allows validation to be performed on the input data,
206 and removes the need for other applications to carefully check the input for
207 errors themselves.
208                 </para>
209         </sect2>
210         <sect2>
211                 <title>The source XML files</title>
212                 <para>
213 Each application provides only a single XML source file, which is installed in the
214 <filename>packages</filename> directory as described above. This file is an XML file
215 whose document element is named <userinput>mime-info</userinput> and whose namespace URI
216 is <ulink url="http://www.freedesktop.org/standards/shared-mime-info"/>. All elements
217 described in this specification MUST have this namespace too.
218                 </para><para>
219 The document element may contain zero or more <userinput>mime-type</userinput> child nodes,
220 in any order, each describing a single MIME type. Each element has a <userinput>type</userinput>
221 attribute giving the MIME type that it describes.
222                 </para><para>
223 Each <userinput>mime-type</userinput> node may contain any combination of the following elements,
224 and in any order:
225                         <itemizedlist>
226                                 <listitem><para>
227 <userinput>glob</userinput> elements have a <userinput>pattern</userinput> attribute. Any file
228 whose name matches this pattern will be given this MIME type (subject to conflicting rules in
229 other files, of course). There is also an optional <userinput>weight</userinput> attribute which
230 is used when resolving conflicts with other glob matches. The default weight value is 50, and
231 the maximum is 100.
232                 </para>
233                 <para>
234 KDE's glob system replaces GNOME's and ROX's ext/regex fields, since it
235 is trivial to detect a pattern in the form '*.ext' and store it in an
236 extension hash table internally. The full power of regular expressions was
237 not being used by either desktop, and glob patterns are more suitable for
238 filename matching anyway.
239                                 </para></listitem>
240                                 <listitem><para>
241 A <userinput>glob-deleteall</userinput> element, which indicates that patterns from
242 previously parsed directories must be discarded. The patterns defined in this file
243 (if any) are used instead.
244                                 </para></listitem>
245                                 <listitem><para>
246 <userinput>magic</userinput> elements contain a list of
247 <userinput>match</userinput> elements, any of which may match, and an optional
248 <userinput>priority</userinput> attribute for all of the contained rules. Low
249 numbers should be used for more generic types (such as 'gzip compressed data')
250 and higher values for specific subtypes (such as a word processor format that
251 happens to use gzip to compress the file). The default priority value is 50, and
252 the maximum is 100.
253                                 </para><para>
254 Each <userinput>match</userinput> element has a number of attributes:
255
256 <informaltable>
257         <tgroup cols="3">
258         <thead><row><entry>Attribute</entry><entry>Required?</entry><entry>Value</entry></row></thead>
259         <tbody>
260
261         <row><entry>type</entry><entry>Yes</entry><entry>
262 <userinput>string</userinput>, <userinput>host16</userinput>,
263 <userinput>host32</userinput>, <userinput>big16</userinput>,
264 <userinput>big32</userinput>, <userinput>little16</userinput>,
265 <userinput>little32</userinput> or <userinput>byte</userinput>.
266         </entry></row>
267
268         <row><entry>offset</entry><entry>Yes</entry><entry>The byte offset(s)
269         in the file to check. This may be a single number or a range in the
270         form `start:end', indicating that all offsets in the range should be
271         checked. The range is inclusive.</entry></row>
272
273         <row><entry>value</entry><entry>Yes</entry><entry>
274         The value to compare the file contents with, in the format indicated by the type
275         attribute.
276         </entry></row>
277
278         <row><entry>mask</entry><entry>No</entry><entry>
279         The number to AND the value in the file with before comparing it to
280         `value'. Masks for numerical types can be any number, while masks for strings
281         must be in base 16, and start with 0x.
282         </entry></row>
283
284         </tbody></tgroup>
285 </informaltable>
286
287 Each element corresponds to one line of
288 <citerefentry><refentrytitle>file</refentrytitle>
289 <manvolnum>1</manvolnum></citerefentry>'s <filename>magic.mime</filename> file.
290 They can be nested in the same way to provide the equivalent of continuation
291 lines. That is, <![CDATA[<a><b/><c/></a>]]> means 'a and (b or c)'.
292                                 </para></listitem>
293                                 <listitem><para>
294 A <userinput>magic-deleteall</userinput> element, which indicates that magic matches from
295 previously parsed directories must be discarded. The magic defined in this file
296 (if any) is used instead.
297                                 </para></listitem>
298                                 <listitem><para>
299 <userinput>alias</userinput> elements indicate that the type is also sometimes
300 known by another name, given by the <userinput>type</userinput> attribute. For
301 example, <userinput>audio/midi</userinput> has an alias of
302 <userinput>audio/x-midi</userinput>. Note that there should not be a
303 <userinput>mime-type</userinput> element defining each alias; a single
304 element defines the canonical name for the type and lists all its aliases.
305                                 </para></listitem>
306                                 <listitem><para>
307 <userinput>sub-class-of</userinput> elements indicate that any data of this
308 type is also some other type, given by the <userinput>type</userinput>
309 attribute. See <xref linkend="subclassing"/>.
310                                 </para></listitem>
311                                 <listitem><para>
312 <userinput>comment</userinput> elements give a human-readable textual description of the MIME
313 type, usually composed of an acronym of the file name extension and a short description, like
314 "ODS spreadsheet".
315 There may be many of these elements with different <userinput>xml:lang</userinput> attributes
316 to provide the text in multiple languages.
317                                 </para></listitem>
318                                 <listitem><para>
319 <userinput>acronym</userinput> elements give experienced users a terse idea of the document contents.
320 for example "ODS", "GEDCOM", "JPEG" and "XML".
321 There may be many of these elements with different <userinput>xml:lang</userinput> attributes
322 to provide the text in multiple languages, although these should only be used if absolutely neccessary.
323                                 </para></listitem>
324                                 <listitem><para>
325 <userinput>expanded-acronym</userinput> elements are the expanded versions of the acronym elements,
326 for example "OpenDocument Spreadsheet", "GEnealogical Data COMmunication", and "eXtensible Markup Language".
327 The purpose of these elements is to provide users a way to look up information on various MIME types or
328 file formats in third-party resources.
329 There may be many of these elements with different <userinput>xml:lang</userinput> attributes
330 to provide the text in multiple languages, although these should only be used if absolutely neccessary.
331                                 </para></listitem>
332                                 <listitem><para>
333 <userinput>icon</userinput> elements specify the icon to be used for this particular mime-type, given
334 by the <userinput>name</userinput> attribute. Generally the icon used for a mimetype is created
335 based on the mime-type by mapping "/" characters to "-", but users can override this by using
336 the <userinput>icon</userinput> element to customize the icon for a particular mimetype.
337 This element is not used in the system database, but only used in the user overridden database.
338 Only one <userinput>icon</userinput> element is allowed.
339                                 </para></listitem>
340                                 <listitem><para>
341 <userinput>generic-icon</userinput> elements specify the icon to use as a generic icon for this
342 particular mime-type, given by the <userinput>name</userinput> attribute. This is used if there
343 is no specific icon (see <userinput>icon</userinput> for how these are found). These are
344 used for categories of similar types (like spreadsheets or archives) that can use a common icon.
345 The Icon Naming Specification lists a set of such icon names. If this element is not specified
346 then the mimetype is used to generate the generic icon by using the top-level media type (e.g.
347 "video" in "video/ogg") and appending "-x-generic" (i.e. "video-x-generic" in the previous example). 
348 Only one <userinput>generic-icon</userinput> element is allowed.
349                                 </para></listitem>
350                                 <listitem><para>
351 <userinput>root-XML</userinput> elements have <userinput>namespaceURI</userinput> 
352 and <userinput>localName</userinput> attributes. If a file is identified as being an XML file,
353 these rules allow a more specific MIME type to be chosen based on the namespace and localname
354 of the document element.
355                                 </para><para>
356 If <userinput>localName</userinput> is present but empty then the document element may have
357 any name, but the namespace must still match.
358                                 </para></listitem>
359                                 <listitem><para>
360 <userinput>treemagic</userinput> elements contain a list of <userinput>treematch</userinput> elements,
361 any of which may match, and an optional <userinput>priority</userinput> attribute for all of the 
362 contained rules. The default priority value is 50, and the maximum is 100.
363                                 </para><para>
364 Each <userinput>treematch</userinput> element has a number of attributes:
365
366 <informaltable>
367         <tgroup cols="3">
368         <thead><row><entry>Attribute</entry><entry>Required?</entry><entry>Value</entry></row></thead>
369         <tbody>
370
371         <row><entry>path</entry><entry>Yes</entry><entry>A path that must be present on the mounted volume/filesystem. The path is interpreted as a relative path starting at the root of the tested volume/filesystem</entry></row>
372         
373         <row><entry>type</entry><entry>No</entry><entry>The type of path. Possible values: <userinput>file</userinput>, <userinput>directory</userinput>, <userinput>link</userinput></entry></row>
374
375         <row><entry>match-case</entry><entry>No</entry><entry>Whether path should be matched case-sensitively. Possible values: <userinput>true</userinput>, <userinput>false</userinput></entry></row>
376
377         <row><entry>executable</entry><entry>No</entry><entry>Whether the file must be executable. Possible values: <userinput>true</userinput>, <userinput>false</userinput></entry></row>
378
379         <row><entry>non-empty</entry><entry>No</entry><entry>Whether the directory must be non-empty. Possible values: <userinput>true</userinput>, <userinput>false</userinput></entry></row>
380
381         <row><entry>mimetype</entry><entry>No</entry><entry>The mimetype for the file at path</entry></row>
382
383         </tbody></tgroup>
384 </informaltable>
385
386 <userinput>treematch</userinput> elements can be nested, meaning that both the outer and the inner <userinput>treematch</userinput>
387 must be satisfied for a "match".
388                                 </para></listitem>
389                         </itemizedlist>
390 Applications may also define their own elements, provided they are namespaced to prevent collisions.
391 Unknown elements are copied directly to the output XML files like <userinput>comment</userinput>
392 elements. A typical use for this would be to indicate the default handler
393 application for a particular desktop
394 ("Galeon is the GNOME default text/html browser"). Note that this doesn't
395 indicate the user's preferred application, only the (fixed) default.
396                 </para>
397                 <para>
398 Here is an example source file, named <filename>diff.xml</filename>:
399                 <programlisting><![CDATA[
400 <?xml version="1.0"?>
401 <mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
402   <mime-type type="text/x-diff">
403     <comment>Differences between files</comment>
404     <comment xml:lang="af">verskille tussen lêers</comment>
405     ...
406     <magic priority="50">
407       <match type="string" offset="0" value="diff\t"/>
408       <match type="string" offset="0" value="***\t"/>
409       <match type="string" offset="0" value="Common subdirectories: "/>
410     </magic>
411     <glob pattern="*.diff"/>
412     <glob pattern="*.patch"/>
413   </mime-type>
414 </mime-info>
415 ]]></programlisting>
416                 </para><para>
417 In practice, common types such as text/x-diff are provided by the freedesktop.org shared
418 database. Also, only new information needs to be provided, since this information will be merged
419 with other information about the same type.
420                 </para>
421         </sect2>
422         <sect2>
423                 <title>The MEDIA/SUBTYPE.xml files</title>
424                 <para>
425 These files have a <userinput>mime-type</userinput> element as the root node. The format is
426 as described above. They are created by merging all the <userinput>mime-type</userinput>
427 elements from the source files and creating one output file per MIME type. Each file may contain
428 information from multiple source files. The <userinput>magic</userinput>,
429 <userinput>glob</userinput> and <userinput>root-XML</userinput> elements will
430 have been removed.
431                 </para>
432                 <para>
433 The example source file given above would (on its own) create an output file called
434 <filename>&lt;MIME&gt;/text/x-diff.xml</filename> containing the following:
435                         <programlisting><![CDATA[
436 <?xml version="1.0" encoding="utf-8"?>
437 <mime-type xmlns="http://www.freedesktop.org/standards/shared-mime-info" type="text/x-diff">
438 <!--Created automatically by update-mime-database. DO NOT EDIT!-->
439   <comment>Differences between files</comment>
440   <comment xml:lang="af">verskille tussen lêers</comment>
441   ...
442 </mime-type>
443
444 ]]></programlisting>
445                 </para>
446         </sect2>
447         <sect2>
448                 <title>The glob files</title>
449                 <para>
450 The globs2 file is a simple list of lines containing weight, MIME type and pattern, separated by a colon.
451 The lines are ordered by glob weight.
452 For example:
453                         <programlisting><![CDATA[
454 # This file was automatically generated by the
455 # update-mime-database command. DO NOT EDIT!
456 ...
457 55:text/x-diff:*.patch
458 50:text/x-diff:*.diff
459 50:text/x-c++src:*.C:cs
460 ...
461 ]]></programlisting>
462                 </para>
463                 <para>
464 The glob file is a simple list of lines containing a MIME type and pattern, separated by a colon. It is
465 deprecated in favour of the globs2 file which also lists the weight of the glob rule.           
466 The lines are ordered by glob weight.
467 For example:
468                         <programlisting><![CDATA[
469 # This file was automatically generated by the
470 # update-mime-database command. DO NOT EDIT!
471 ...
472 text/x-diff:*.patch
473 text/x-diff:*.diff
474 ...
475 ]]></programlisting>
476                 </para>
477                 <para>
478 Applications MUST match globs case-insensitively, except when the case-sensitive attribute
479 is set to true.
480 This is so that e.g. <filename>main.C</filename> will be seen as a C++ file,
481 but <filename>IMAGE.GIF</filename> will still use the *.gif pattern.
482                 </para>
483                 <para>
484 If several patterns of the same weight match then the longest pattern SHOULD be used.
485 In particular, files with multiple extensions (such as
486 <filename>Data.tar.gz</filename>) MUST match the longest sequence of extensions
487 (eg '*.tar.gz' in preference to '*.gz'). Literal patterns (eg, 'Makefile') must
488 be matched before all others. It is suggested that patterns beginning with `*.'
489 and containing no other special characters (`*?[') should be placed in a hash
490 table for efficient lookup, since this covers the majority of the patterns. Thus,
491 patterns of this form should be matched before other wildcarded patterns.
492                 </para>
493                 <para>
494 If a matching pattern is provided by two or more MIME types, applications
495 SHOULD not rely on one of them. They are instead supposed to use magic data
496 (see below) to detect the actual MIME type. This is for instance required to
497 deal with container formats like Ogg or AVI, that map various video and/or
498 audio-encoded data to one extension.
499                 </para>
500                 <para>
501 There may be several rules mapping to the same type. They should all be merged.
502 If the same pattern is defined twice, then they MUST be ordered by the
503 directory the rule came from, as described above.
504                 </para>
505                 <para>
506 The <userinput>glob-deleteall</userinput> element, which means that implementations
507 SHOULD discard information from previous directories, is written out into the globs2 file using
508 __NOGLOBS__ as the pattern. For instance:
509                         <programlisting><![CDATA[
510 0:text/x-diff:__NOGLOBS__
511 50:text/x-diff:*.diff
512 ...
513 ]]></programlisting>
514                 </para>
515                 <para>
516 In the above example, the mimetype text/x-diff is redefined (for instance in a user's
517 ~/.local/share/mime) to only be associated with the pattern *.diff, so the other patterns
518 like *.patch were removed. The weight in front of the __NOGLOBS__ line is ignored.
519 In a given globs2 file, the __NOGLOBS__ line for a given mimetype is always written
520 out before any other globs for this mimetype.
521                 </para>
522                 <para>
523 Lines beginning with `#' are comments and should be ignored. Everything from
524 the `:' character to the newline is part of the pattern; spaces should not be
525 stripped. The file is in the UTF-8 encoding. The format of the glob pattern
526 is as for fnmatch(3). The format does not allow a pattern to contain a literal
527 newline character, but this is not expected to be a problem.
528                 </para>
529                 <para>
530 Common types (such as MS Word Documents) will be provided in the X Desktop
531 Group's package, which MUST be required by all applications using this
532 specification. Since each application will then only be providing information
533 about its own types, conflicts should be rare.
534                 </para>
535                 <para>
536 The fourth field ("cs" in the first globs2 example) contains a list of comma-separated flags.
537 The flags currently defined are: cs (for case-sensitive). Implementations should ignore
538 unknown flags.
539                 </para>
540                 <para>
541 Implementations should also ignore further fields, so that the syntax of the globs2 file
542 can be extended in the future. Example: "50:text/x-c++src:*.C:cs,newflag:newfeature:somethingelse"
543 should currently be parsed as "50:text/x-c++src:*.C:cs".
544                 </para>
545         </sect2>
546         <sect2>
547                 <title>The magic files</title>
548                 <para>
549 The magic data is stored in a binary format for ease of parsing. The old magic database
550 had complex escaping rules; these are now handled by <command>update-mime-database</command>.
551                 </para><para>
552 The file starts with the magic string "MIME-Magic\0\n".
553 There is no version number in the file. Incompatible changes will be handled by
554 creating both the current `magic' file and a newer `magic2' in the new format.
555 Where possible, compatible changes only will be made.
556 All numbers are big-endian, so need to be byte-swapped on little-endian machines.
557                 </para><para>
558 The rest of the file is made up of a sequence of small sections.
559 Each section is introduced by giving the priority and type in brackets, followed by
560 a newline character. Higher priority entries come first. Example:
561 <screen>[50:text/x-diff]\n</screen>
562 Each line in the section takes the form:
563 <screen>[ indent ] ">" start-offset "=" value
564 [ "&amp;" mask ] [ "~" word-size ] [ "+" range-length ] "\n"</screen>
565 <informaltable>
566         <tgroup cols="3">
567         <thead><row><entry>Part</entry><entry>Example</entry><entry>Meaning</entry></row></thead>
568         <tbody>
569
570         <row><entry>indent</entry><entry>1</entry><entry>The nesting
571         depth of the rule, corresponding to the number of '>' characters in the traditional file format.</entry></row>
572         <row><entry>">" start-offset</entry><entry>&gt;4</entry><entry>The offset into the
573         file to look for a match.</entry></row>
574         <row><entry>"=" value</entry><entry>=\0x0\0x2\0x55\0x40</entry><entry>
575         Two bytes giving the (big-endian) length of the value, followed by the value itself.
576         </entry></row>
577         <row><entry>"&amp;" mask</entry><entry>&amp;\0xff\0xf0</entry><entry>
578         The mask, which (if present) is exactly the same length as the value.
579         </entry></row>
580         <row><entry>"~" word-size</entry><entry>~2</entry><entry>On little-endian machines, the
581         size of each group to byte-swap.</entry></row>
582         <row><entry>"+" range-length</entry><entry>+8</entry><entry>The length of the region
583         in the file to check.
584         </entry></row>
585         </tbody>
586         </tgroup>
587 </informaltable>
588                 </para><para>
589 Note that the value, value length and mask are all binary, whereas everything
590 else is textual. Each of the elements begins with a single character to
591 identify it, except for the indent level.
592                 </para><para>
593 The word size is used for byte-swapping. Little-endian systems should reverse
594 the order of groups of bytes in the value and mask if this is greater than one.
595 This only affects `host' matches (`big32' entries still have a word size of 1,
596 for example, because no swapping is necessary, whereas `host32' has a word size
597 of 4).
598                 </para><para>
599 The indent, range-length, word-size and mask components are optional. If
600 missing, indent defaults to 0, range-length to 1, the word-size to 1, and the
601 mask to all 'one' bits.
602                 </para><para>
603 Indent corresponds to the nesting depth of the rule. Top-level rules have an
604 indent of zero. The parent of an entry is the preceding entry with an indent
605 one less than the entry.
606                 </para><para>
607 If an unknown character is found where a newline is expected then the whole
608 line should be ignored (there will be no binary data after the new
609 character, so the next line starts after the next "\n" character). This is for
610 future extensions.
611                 </para><para>
612 The text/x-diff above example would (on its own) create this magic file:
613                         <programlisting><![CDATA[
614 00000000  4d 49 4d 45 2d 4d 61 67  69 63 00 0a 5b 35 30 3a  |MIME-Magic..[50:|
615 00000010  74 65 78 74 2f 78 2d 64  69 66 66 5d 0a 3e 30 3d  |text/x-diff].>0=|
616 00000020  00 05 64 69 66 66 09 0a  3e 30 3d 00 04 2a 2a 2a  |..diff..>0=..***|
617 00000030  09 0a 3e 30 3d 00 17 43  6f 6d 6d 6f 6e 20 73 75  |..>0=..Common su|
618 00000040  62 64 69 72 65 63 74 6f  72 69 65 73 3a 20 0a     |bdirectories: .|
619 ]]></programlisting>
620                 </para>
621                 <para>
622 The <userinput>magic-deleteall</userinput> attribute, which means that implementations
623 SHOULD discard information from previous directories, is written out into the magic file using
624 __NOMAGIC__ as the value:
625 <screen>>0=__NOMAGIC__\n</screen>
626 This can be followed by other magic rules for the mimetype.
627                 </para>
628         </sect2>
629         <sect2>
630                 <title>The XMLnamespaces files</title>
631                 <para>
632 Each <filename>XMLnamespaces</filename> file is a list of lines in the form:
633 <screen>namespaceURI " " localName " " MIME-Type "\n"</screen>
634 For example:
635 <screen>
636 http://www.w3.org/1999/xhtml html application/xhtml+xml
637 </screen>
638 The lines are sorted (using strcmp in the C locale) and there are no lines with the same namespaceURI and
639 localName in one file. If the localName was empty then there will be two spaces following
640 the namespaceURI.
641                 </para>
642         </sect2>
643         <sect2>
644                 <title>The icon files</title>
645                 <para>
646 The <filename>icons</filename> and <filename>generic-icons</filename> files are list of lines in the form:
647 <screen>MIME-Type ":" icon-name "\n"</screen>
648 For example:
649 <screen>
650 application/msword:x-office-document
651 </screen>
652                 </para>
653         </sect2>
654         <sect2>
655                 <title>The treemagic files</title>
656                 <para>
657 The tree magic data is stored in a file with a format that is very similar to the magic file format.
658                 </para>
659                 <para>
660 The file starts with the magic string "MIME-TreeMagic\0\n". There is no version number in the file.
661 Incompatible changes will be handled by creating both the current `treemagic' and a newer `treemagic2' 
662 in the new format. Where possible, changes will be made in a compatible fashion. 
663                 </para>
664                 <para>
665 The rest of the file is made up of a sequence of small sections. Each section is introduced by giving
666 the priority and type in brackeds, followed by a newline character. Higher priority entries come
667 first. Example:
668 <screen>[50:x-content/image-dcf]\n</screen>
669 Each line in the section takes the form:
670 <screen>[ indent ] ">" "\"" path "\"" "=" type [ "," option ]* "\n"</screen>
671 <informaltable>
672         <tgroup cols="2">
673         <thead><row><entry>Part</entry><entry>Meaning</entry></row></thead>
674         <tbody>
675
676         <row><entry>indent</entry><entry>The nesting depth of the rule.</entry></row>
677         <row><entry>path</entry><entry>The path to match.</entry></row>
678         <row><entry>type</entry><entry>The required file type, one of "file", "directory", "link" or "any"</entry></row>
679         <row><entry>option</entry><entry>Optional for the optional attributes of <userinput>treematch</userinput> elements. 
680 Possible values are "executable", "match-case", "non-empty", or a MIME type</entry></row>
681         </tbody>
682         </tgroup>
683 </informaltable>
684                 </para><para>
685                 </para>
686         </sect2>
687         <sect2>
688                 <title>The mime.cache files</title>
689                 <para>
690 The <filename>mime.cache</filename> files contain the same information as the 
691 <filename>globs2</filename>, <filename>magic</filename>, <filename>subclasses</filename>, 
692 <filename>aliases</filename> and <filename>XMLnamespaces</filename> files, in a binary, 
693 mmappable format:
694 </para>
695 <programlisting>
696 Header:
697 2                       CARD16          MAJOR_VERSION   1
698 2                       CARD16          MINOR_VERSION   2
699 4                       CARD32          ALIAS_LIST_OFFSET
700 4                       CARD32          PARENT_LIST_OFFSET
701 4                       CARD32          LITERAL_LIST_OFFSET
702 4                       CARD32          REVERSE_SUFFIX_TREE_OFFSET
703 4                       CARD32          GLOB_LIST_OFFSET
704 4                       CARD32          MAGIC_LIST_OFFSET
705 4                       CARD32          NAMESPACE_LIST_OFFSET
706 4                       CARD32          ICONS_LIST_OFFSET
707 4                       CARD32          GENERIC_ICONS_LIST_OFFSET
708
709 AliasList:
710 4                       CARD32          N_ALIASES
711 8*N_ALIASES             AliasListEntry
712
713 AliasListEntry:
714 4                       CARD32          ALIAS_OFFSET
715 4                       CARD32          MIME_TYPE_OFFSET
716
717 ParentList:
718 4                       CARD32          N_ENTRIES 
719 8*N_ENTRIES             ParentListEntry
720
721 ParentListEntry:
722 4                       CARD32          MIME_TYPE_OFFSET
723 4                       CARD32          PARENTS_OFFSET
724
725 Parents:
726 4                       CARD32          N_PARENTS
727 4*N_PARENTS             CARD32          MIME_TYPE_OFFSET
728
729 LiteralList:
730 4                       CARD32          N_LITERALS
731 12*N_LITERALS           LiteralEntry    
732
733 LiteralEntry:
734 4                       CARD32          LITERAL_OFFSET
735 4                       CARD32          MIME_TYPE_OFFSET
736 4                       CARD32          WEIGHT in lower 8 bits
737                                         FLAGS in rest:
738                                         0x100 = case-sensitive
739
740
741 GlobList:
742 4                       CARD32          N_GLOBS
743 12*N_GLOBS              GlobEntry       
744
745 GlobEntry:
746 4                       CARD32          GLOB_OFFSET
747 4                       CARD32          MIME_TYPE_OFFSET
748 4                       CARD32          WEIGHT in lower 8 bits
749                                         FLAGS in rest:
750                                         0x100 = case-sensitive
751
752 ReverseSuffixTree:
753 4                       CARD32          N_ROOTS
754 4                       CARD32          FIRST_ROOT_OFFSET
755
756 ReverseSuffixTreeNode:
757 4                       CARD32          CHARACTER
758 4                       CARD32          N_CHILDREN                      
759 4                       CARD32          FIRST_CHILD_OFFSET
760
761 ReverseSuffixTreeLeafNode:
762 4                       CARD32          0 
763 4                       CARD32          MIME_TYPE_OFFSET
764 4                       CARD32          WEIGHT in lower 8 bits
765                                         FLAGS in rest:
766                                         0x100 = case-sensitive
767
768 MagicList:
769 4                       CARD32          N_MATCHES
770 4                       CARD32          MAX_EXTENT
771 4                       CARD32          FIRST_MATCH_OFFSET
772
773 Match:
774 4                       CARD32          PRIORITY
775 4                       CARD32          MIME_TYPE_OFFSET
776 4                       CARD32          N_MATCHLETS
777 4                       CARD32          FIRST_MATCHLET_OFFSET
778
779 Matchlet:
780 4                       CARD32          RANGE_START
781 4                       CARD32          RANGE_LENGTH
782 4                       CARD32          WORD_SIZE
783 4                       CARD32          VALUE_LENGTH
784 4                       CARD32          VALUE_OFFSET
785 4                       CARD32          MASK_OFFSET (0 if no mask)
786 4                       CARD32          N_CHILDREN
787 4                       CARD32          FIRST_CHILD_OFFSET
788
789 NamespaceList:
790 4                       CARD32          N_NAMESPACES
791 12*N_NAMESPACES         NamespaceEntry  
792
793 NamespaceEntry:
794 4                       CARD32          NAMESPACE_URI_OFFSET
795 4                       CARD32          LOCAL_NAME_OFFSET
796 4                       CARD32          MIME_TYPE_OFFSET
797
798 GenericIconsList:
799 IconsList:
800 4                       CARD32          N_ICONS
801 8*N_ICONS               IconListEntry
802
803 IconListEntry:
804 4                       CARD32          MIME_TYPE_OFFSET
805 4                       CARD32          ICON_NAME_OFFSET
806 </programlisting>
807 <para>
808 Lists in the file are sorted, to enable binary searching. The list of 
809 aliases is sorted by alias, the list of literal globs is sorted by the 
810 literal. The SuffixTreeNode siblings are sorted by character. 
811 The list of namespaces is sorted by namespace uri. The list of icons
812 is sorted by mimetype.
813 </para>
814 <para>
815 Mimetypes are stored in the suffix tree by appending suffix
816 tree leaf nodes with '\0' as character. These nodes appear at the
817 beginning of the list of children.
818 </para>
819 <para>
820 All offsets are in bytes from the beginning of the file.
821 </para>
822 <para>
823 Strings are zero-terminated.
824 </para>
825 <para>
826 All numbers are in network (big-endian) order. This is necessary because the data will be stored in 
827 arch-independent directories like <filename>/usr/share/mime</filename> or even in user's home directories.
828 </para>
829 <para>
830 Cache files have to be written atomically - write to a temporary name, then move over the old file - so 
831 that clients that have the old cache file open and mmap'ed won't get corrupt data.
832 </para>
833         </sect2>
834         <sect2>
835                 <title>Storing the MIME type using Extended Attributes</title>
836                 <para>
837 An implementation MAY also get a file's MIME type from the
838 <userinput>user.mime_type</userinput> extended attribute. <!-- The attr(5) man
839 page documents this name --> The type given here should normally be used in
840 preference to any guessed type, since the user is able to set it explicitly.
841 Applications MAY choose to set the type when saving files. Since many
842 applications and filesystems do not support extended attributes,
843 implementations MUST NOT rely on this method being available.
844                 </para>
845         </sect2>
846         <sect2 id="subclassing">
847                 <title>Subclassing</title>
848                 <para>
849 A type is a subclass of another type if any instance of the first type is
850 also an instance of the second. For example, all image/svg files are also
851 text/xml, text/plain and application/octet-stream files. Subclassing is about
852 the format, rather than the category of the data (for example, there is no
853 'generic spreadsheet' class that all spreadsheets inherit from).
854                 </para>
855                 <para>
856 Some subclass rules are implicit:
857                         <itemizedlist>
858 <listitem><para>All text/* types are subclasses of text/plain.</para></listitem>
859 <listitem><para>All streamable types (ie, everything except the inode/* types)
860 are subclasses of application/octet-stream.</para></listitem>
861                         </itemizedlist>
862 In addition to these rules, explicit subclass information may be given using
863 the <userinput>sub-class-of</userinput> element.
864                 </para>
865                 <para>
866 Note that some file formats are also compressed files (application/x-jar files
867 are also application/zip files). However, this is different to a case such as a
868 compressed postscript file, which is not a valid postscript file itself (so
869 application/x-gzpostscript does not inherit from application/postscript,
870 because an application that can handle the latter may not cope with the
871 former).
872                 </para>
873                 <para>
874 Some types may or may not be instances of other types. For example, a
875 spreadsheet file may be compressed or not. It is a valid spreadsheet file
876 either way, but only inherits from application/x-gzip in one case. This
877 information cannot be represented statically; instead an application
878 interested in this information should run all of the magic rules, and
879 use the list of types returned as the subclasses.
880                 </para>
881         </sect2>
882         <sect2>
883                 <title>Recommended checking order</title>
884                 <para>
885 Because different applications have different requirements, they may choose to
886 use the various methods provided by this specification in any order. However, the
887 RECOMMENDED order to perform the checks is:
888                         <itemizedlist>
889                                 <listitem><para>
890 If a MIME type is provided explicitly (eg, by a ContentType HTTP header, a MIME
891 email attachment, an extended attribute or some other means) then that should
892 be used instead of guessing.
893                                 </para></listitem>
894
895                                 <listitem><para>
896 Otherwise, start by doing a glob match of the filename. Keep only globs with the biggest weight.
897 If the patterns are different, keep only globs with the longest pattern, as previously discussed.
898 If after this, there is one or more matching glob, and all the matching globs
899 result in the same mimetype, use that mimetype as the result.
900                                 </para></listitem>
901                                 
902                                 <listitem><para>
903 If the glob matching fails or results in multiple conflicting mimetypes, read the
904 contents of the file and do magic sniffing on it. If no magic rule matches the data (or if
905 the content is not available), use the default type of application/octet-stream for
906 binary data, or text/plain for textual data. If there was no glob match, use the magic match
907 as the result. 
908                                 </para><para>
909 Note: Checking the first 32 bytes of the file for ASCII control characters is
910 a good way to guess whether a file is binary or text, but note that files with high-bit-set
911 characters should still be treated as text since these can appear in UTF-8 text,
912 unlike control characters.
913                                 </para></listitem>
914                                 
915                                 <listitem><para>
916 If any of the mimetypes resulting from a glob match is equal to or a subclass of
917 the result from the magic sniffing, use this as the result. This allows us for example to
918 distinguish text files called "foo.doc" from MS-Word files with the same name, as the
919 magic match for the MS-Word file would be application/x-ole-storage which the MS-Word type
920 inherits.
921                                 </para></listitem>
922                                 
923                                 <listitem><para>
924 Otherwise use the result of the glob match that has the highest weight.
925                                 </para></listitem>
926                         </itemizedlist>
927                 </para>
928                 <para>
929 There are several reasons for checking the glob patterns before the magic.
930 First of all doing magic sniffing is very expensive as reading the contents of the files
931 causes a lot of seeks, which is very expensive. Secondly, some applications don't check
932 the magic at all (sometimes the content is not available or too slow to read), and this
933 makes it more likely that both will get the same type.
934                 </para>
935                 <para>
936 Also, users can easily understand why calling their
937 text file <filename>README.mp3</filename> makes the system think it's an MP3,
938 whereas they have trouble understanding why their computer thinks
939 <filename>README.txt</filename> is a PostScript file. If the system guesses wrongly,
940 the user can often rename the file to fix the problem.
941                 </para>
942         </sect2>
943         <sect2>
944                 <title>Non-regular files</title>
945                 <para>
946 Sometimes it is useful to assign MIME types to other objects in the filesystem,
947 such as directories, sockets and device files. This could be useful when looking up
948 an icon for a type, or for providing a textual description of one of these objects.
949 The media type 'inode' is provided for this purpose, with the following types corresponding
950 to the standard types of object found in a Unix filesystem:
951                 </para>
952                 <simplelist>
953                         <member>inode/blockdevice</member>
954                         <member>inode/chardevice</member>
955                         <member>inode/directory</member>
956                         <member>inode/fifo</member>
957                         <member>inode/mount-point</member>
958                         <member>inode/socket</member>
959                         <member>inode/symlink</member>
960                 </simplelist>
961                 <para>
962 An inode/mount-point is a subclass of inode/directory. It can be useful when adding extra
963 actions for these directories, such as 'mount' or 'eject'. Mounted directories can be
964 detected by comparing the 'st_dev' of a directory with that of its parent. If
965 they differ, they are from different devices and the directory is a mount
966 point.
967                 </para>
968         </sect2>
969         <sect2>
970                 <title>Content types for volumes</title>
971                 <para>
972 Traditional MIME types apply to individual files or bytestreams. It is often useful 
973 to apply the same methodologies when classifying the content of mountable volumes or 
974 filesystems. The x-content type has been introduced for this purpose. Typical examples 
975 are x-content/audio-dvd, x-content/blank-cd or x-content/image-dcf. 
976                 </para>
977                 <para>
978 Matching of content types works with <userinput>treemagic</userinput> elements, which 
979 are analogous to the <userinput>magic</userinput> elements used for MIME type matching.
980 Instead of looking for byte sequences in files, <userinput>treemagic</userinput> element
981 allow to look for files with certain names, permissions or mime types in a directory
982 hierarchy.
983                 </para>
984         </sect2>
985         <sect2>
986                 <title>URI scheme handlers</title>
987                 <para>
988 URI scheme handling (such as a movie player handling mms:// URIs, or a Podcast program 
989 handling feed:// URIs) are handled through applications handling the x-scheme-handler/foo
990 mime-type, where foo is the URI scheme in question.
991                 </para>
992                 <para>
993 This scheme allows URI scheme handling to enjoy the same benefits as mime-type handlers,
994 such as the ability to change the default handler, the cross-desktop support, and
995 easier application launching.
996                 </para>
997                 <para>
998 Note that this virtual mime-type is not for listing URI schemes that an application 
999 can load files from. For example, a movie player would not list x-scheme-handler/http 
1000 in its supported mime-types, but it would list x-scheme-handler/rtsp if it supported 
1001 playing back from RTSP locations.
1002                 </para>
1003         </sect2>
1004         <sect2>
1005                 <title>Security implications</title>
1006                 <para>
1007 The system described in this document is intended to allow different programs
1008 to see the same file as having the same type. This is to help interoperability.
1009 The type determined in this way is only a guess, and an application MUST NOT
1010 trust a file based simply on its MIME type. For example, a downloader should
1011 not pass a file directly to a launcher application without confirmation simply
1012 because the type looks `harmless' (eg, text/plain).
1013                 </para>
1014                 <para>
1015 Do not rely on two applications getting the same type for the same file, even
1016 if they both use this system. The spec allows some leeway in implementation,
1017 and in any case the programs may be following different versions of the spec.
1018                 </para>
1019         </sect2>
1020         <sect2>
1021                 <title>User modification</title>
1022                 <para>
1023 The MIME database is NOT intended to store user preferences. Users should never
1024 edit the database. If they wish to make corrections or provide MIME entries for
1025 software that doesn't provide these itself, they should do so by means of the
1026 Override.xml mentioned in <xref linkend="s2_layout"/>. Information such as
1027 "text/html files need to be opened with Mozilla" should NOT go in the database.
1028                 </para>
1029         </sect2>
1030 </sect1>
1031
1032 <sect1>
1033         <title>Contributors</title>
1034         <simplelist>
1035                 <member>
1036                         Thomas Leonard <email>tal197 at users.sf.net</email>
1037                 </member>
1038                 <member>
1039                         David Faure <email>faure at kde.org</email>
1040                 </member>
1041                 <member>
1042                         Alex Larsson <email>alexl at redhat.com</email>
1043                 </member>
1044                 <member>
1045                         Seth Nickell <email>snickell at stanford.edu</email>
1046                 </member>
1047                 <member>
1048                         Keith Packard <email>keithp at keithp.com</email>
1049                 </member>
1050                 <member>
1051                         Filip Van Raemdonck <email>mechanix at debian.org</email>
1052                 </member>
1053                 <member>
1054                         Christos Zoulas <email>christos at zoulas.com</email>
1055                 </member>
1056                 <member>
1057                         Matthias Clasen <email>mclasen at redhat.com</email>
1058                 </member>
1059                 <member>
1060                         Bastien Nocera <email>hadess at hadess.net</email>
1061                 </member>
1062         </simplelist>
1063 </sect1>
1064
1065 <bibliography>
1066         <title>References</title>
1067
1068         <bibliomixed>
1069                 <abbrev>GNOME</abbrev><citetitle>The GNOME desktop,
1070                 <ulink url="http://www.gnome.org"/></citetitle>
1071         </bibliomixed>
1072         <bibliomixed>
1073                 <abbrev>KDE</abbrev><citetitle>The KDE desktop,
1074                 <ulink url="http://www.kde.org"/></citetitle>
1075         </bibliomixed>
1076         <bibliomixed>
1077                 <abbrev>ROX</abbrev><citetitle>The ROX desktop,
1078                 <ulink url="http://rox.sourceforge.net"/></citetitle>
1079         </bibliomixed>
1080         <bibliomixed>
1081                 <abbrev>DesktopEntries</abbrev><citetitle>Desktop Entry Specification,
1082                 <ulink url="http://www.freedesktop.org/standards/desktop-entry-spec.html"/>
1083                 </citetitle>
1084         </bibliomixed>
1085         <bibliomixed>
1086                 <abbrev>SharedMIME</abbrev><citetitle>Shared MIME-info Database,
1087                 <ulink url="http://www.freedesktop.org/standards/shared-mime-info.html"/>
1088                 </citetitle>
1089         </bibliomixed>
1090         <bibliomixed>
1091                 <abbrev>RFC-2119</abbrev>
1092                 <citetitle>Key words for use in RFCs to Indicate Requirement Levels,
1093                 <ulink url="http://www.ietf.org/rfc/rfc2119.txt?number=2119"/>
1094                 </citetitle>
1095         </bibliomixed>
1096         <bibliomixed>
1097                 <abbrev>BaseDir</abbrev>
1098                 <citetitle>XDG Base Directory Specification
1099                 <ulink url="http://www.freedesktop.org/standards/basedir/draft/basedir-spec/basedir-spec.html"/>
1100                 </citetitle>
1101         </bibliomixed>
1102         <bibliomixed>
1103                 <abbrev>ACAP</abbrev>
1104                 <citetitle>ACAP Media Type Dataset Class
1105                 <ulink url="ftp://ftp.ietf.org/internet-drafts/draft-ietf-acap-mediatype-01.txt"/>
1106                 </citetitle>
1107         </bibliomixed>
1108 </bibliography>
1109
1110 </article>