Categories
Apache Web Server XML XSLT

An XSLT stylesheet does not have an XML mimetype:

Full error message: Error loading stylesheet: An XSLT stylesheet does not have an XML mimetype:

Error occured on Firefox 2.0 when working with XML, XSLT.

xml file:

<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="product-list.xslt"?>
<f>PRODUCT DETAILS</f>

xslt file

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<stylesheet version="1.0" xmlns="http://www.w3.org/1999/XSL/Transform">
<template match="/">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>aaa</title>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="alert('x');">
<value-of select="f"/>
</body>
</html>
</template>
</stylesheet>

The error occurs because the web server (in my case Apache) had this entry in the mime.types file:

text/xml            xml xsl

The fix in my case is:
Change extenstion from xslt to xls on the stylesheet file or add xslt to the text/xml entry in mime.types file in Apache.

4 replies on “An XSLT stylesheet does not have an XML mimetype:”

In my case, my shared hosting already have “application/xml xml xsl” but still not working. (my stylesheet file extension is xsl)

The solution is to add xsl to the text/xsl mime type.

Please read the article because it explains how to fix this error.

However, I’m 90% sure that the bots will not see the error and they will get the file without any problems.

I am having the same problem with and xml sitemap on my wordpress website…

this error I am only getting in firefox,

in opera , ie , and flock , and safari, and I am only gettign the error in firefox

Comments are closed.