[clahey at ximian.com: docbook mime type detection]

Luis Villa luis.villa at gmail.com
Wed Jul 27 00:02:47 EEST 2005


On 7/26/05, Bastien Nocera <hadess at hadess.net> wrote:
> Hey Luis,
> 
> On Tue, 2005-07-26 at 16:48 -0400, Luis Villa wrote:
> > <?xml version="1.0" encoding="UTF-8"?>
> >
> > <mime-info
> > xmlns="http://www.freedesktop.org/standards/shared-mime-info">
> >  <mime-type type="application/docbook+xml">
> >   <sub-class-of type="text/xml"/>
> >   <comment xml:lang="en">Docbook XML Document</comment>
> >   <magic priority="60">
> >    <match type="string" value='docbookx.dtd' offset="0:200"/>
> 
> Do you really need to go 200 bytes into the file? The further you need
> to go into the file, the more expensive it is. I would also add that my
> text file mentioning "docbookx.dtd" would get detected as a docbook
> file, not good.

Yeah, knew this one was imperfect; I can clean it up if people
actually want to go this way to sniff things.

> >   </magic>
> >   <glob pattern="*.xml"/>
> 
> That's not good. text/xml files are already detected with *.xml.

What would be preferable then? (I looked for what ogg tarkin does, but
no success- seems it isn't in the primary DB either?)

> >  </mime-type>
> > </mime-info>
> 
> You got the gist of it, but it's not commitable.

Well, I didn't figure that ;) like I said, Works For Me, but if people
actually want it committed I can play a bit more.

Luis



More information about the xdg mailing list