text/xml vs application/xml
Eric van der Vlist
vdv at dyomedea.com
Tue Nov 22 07:08:47 PST 2005
Hi,
I came on the share mime type database no later than yesterday and I
hope I am not raising a permathread (that doesn't seem to be the case
according to my googling, but you can never know!)...
The "text/xml" mime type is often considered harmful and many people
prefer to use application/xml instead.
The reason why this is the case is that mime types are still described
by the RFC 2045 and 2046 and that RFC 2046 says that the default
encoding for all the text/* types is ASCII:
"The default character set, which must be assumed in the absence of a
charset parameter, is US-ASCII."
Being conform to this statement means that any "text/xml" document
served on an HTTP server that do not specify a charset or a file system
that doesn't provide this information MUST be considered as ASCII and
that invalidates a majority of XML documents (at least out of English
speaking countries).
This has been commented a couple of articles on XML.com:
* http://www.xml.com/pub/a/2004/07/21/dive.html
* http://www.xml.com/pub/a/2005/06/08/restful.html
I don't know the implications of making such a change on existing
applications, but the a suggestion would be to declare the XML type as
"application/xml" with an alias "text/xml" and having "text/plain" as a
sub class.
Would that make sense?
Eric
PS: I am wondering how you deal with these charset issues beyond XML and
may have missed something here, see:
http://eric.van-der-vlist.com/blog/1614_The_complex_simple_problem_of_media_types.item
--
If you have a XML document, you have its schema.
http://examplotron.org
------------------------------------------------------------------------
Eric van der Vlist http://xmlfr.org http://dyomedea.com
(ISO) RELAX NG ISBN:0-596-00421-4 http://oreilly.com/catalog/relax
(W3C) XML Schema ISBN:0-596-00252-1 http://oreilly.com/catalog/xmlschema
------------------------------------------------------------------------
More information about the xdg
mailing list