Chrome says: Resource interpreted as Stylesheet but transferred with MIME type application/xml

xml, xslt

Solution

The XSLT 1.0 spec clearly states that the appropriate MIME type for XSLT is text/xml and application/xml

The MIME media types text/xml and application/xml [RFC2376] should be used for XSLT stylesheets. It is possible that a media type will be registered specifically for XSLT stylesheets; if and when it is, that media type may also be used.

In XSLT 2.0 this was changed to application/xslt+xml.

But

In the absence of a registered media type for XSLT stylesheets, some vendors' products have adopted different conventions, notably type="text/xsl".

Chrome 32.0.1700.107 returns errors:

Resource interpreted as Stylesheet but transferred with MIME type text/xml;

Resource interpreted as Stylesheet but transferred with MIME type application/xml;

Resource interpreted as Stylesheet but transferred with MIME type application/xslt+xml;

Chrome returns no error if text/xsl type passed.

Problem

I have an XML file which is styled using an XSL file. When opening the XML file in Firefox, I get no problems, (although strangely, sometimes it will only display after I hit "reload"), but in Chrome/Chromium I get the error message: ``` Resource interpreted as Stylesheet but transferred with MIME type application/xml ``` The files are up here: http://jonreeve.com/test/mike/biblexml.xml I don't think there's anything irregular about the XML/XSL syntax, and the links all seem to be worded correctly, too. Furthermore, this doesn't seem to be similar to all the similar-looking questions here, which seem to be dealing with javascript and other applications. This one is just pure XML/XSL.

Original source