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.
The XSLT 1.0 spec clearly states that the appropriate MIME type for XSLT is text/xml and application/xml
In XSLT 2.0 this was changed to application/xslt+xml.
But
Chrome 32.0.1700.107 returns errors:
Chrome returns no error if text/xsl type passed.
XSLT should be delivered with MIME type
application/xslt+xml
, notapplication/xml
. You should configure your server to do so. You need a.htaccess
file that contains the lineThis associates the extension
.xsl
with the correct MIME type. If you already have a.htaccess
file in the XSLT's directory or in a parent directory, you can add the line. Otherwise, create such a file.