Bug 19201

Summary: Use namespaceURI in detection
Product: shared-mime-info Reporter: Daniel Leidert <daniel.leidert.spam>
Component: freedesktop.org.xmlAssignee: Shared Mime Info group <shared_mime_info>
Status: RESOLVED MOVED QA Contact:
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Bug Depends on: 21316    
Bug Blocks:    
Attachments: testcase (application/xhtml+xml)
testcase 2 (only kmime)

Description Daniel Leidert 2008-12-20 07:26:41 UTC
I'm not sure, if this is an issue in gvfs/gio and kmime or in the database. ATM several XML files are detected as text/html. E.g. XHTML files are detected as text/html, although they have an XML declaration and use the correct namespace URI and local name. In my case, an XML file format, which uses a <header> element is detected as text/html.

I've opened a bug report against GIO at http://bugzilla.gnome.org/565176. Maybe you can comment here (or in the gnome bugzilla) on this issue, if this should be fixed in the database or in gvfs/gio and kmime.
Comment 1 Bastien Nocera 2009-01-08 07:44:13 UTC
Please upload specific test cases.
Comment 2 Bastien Nocera 2009-02-09 06:53:39 UTC
As mentioned in the upstream bug, we need test cases. Reopen when you have some.
Comment 3 Daniel Leidert 2009-02-09 13:07:29 UTC
Created attachment 22732 [details]
testcase (application/xhtml+xml)

The attached file is a valid XHTML document but is not detected as such (neither by kmimetypefinder nor gnomevfs-info nor gvfs-info).
Comment 4 Daniel Leidert 2009-02-09 13:12:09 UTC
Created attachment 22733 [details]
testcase 2 (only kmime)

This is a (stripped-down) testcase, which doesn't work for kmimetypefinder. kmime detects it as text/html, although this is a simple XML document (not even HTML). file, gnomevfs and gvfs correctly detect the MIME type. So this second testcase is more related to the kmime implementation than to the shared-mime-info database.
Comment 5 Daniel Leidert 2009-02-09 13:17:17 UTC
I attached two testcases. Reopening. I tested on a recent Debian Sid. Can you reprosuce the issue?
Comment 6 Bastien Nocera 2009-04-21 01:53:11 UTC
Not sure how to fix the bflang file, but the xhtml file would be fixed if xdgmime actually used the namespaceURI defined in the database.

I've committed both test files, but disabled for now.
Comment 7 Daniel Leidert 2010-01-29 13:15:01 UTC
*** Bug 26316 has been marked as a duplicate of this bug. ***
Comment 8 GitLab Migration User 2018-10-13 10:36:11 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xdg/shared-mime-info/issues/4.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.