Fixing “Error loading stylesheet: An XSLT stylesheet does not have an XML mimetype”

Some people might encounter an XSLT stylesheet rendering error if their servers are configured to render .xsl files. The error is:

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

There’s an easy fix for the above error.

Apache

If you’re running Apache, simply edit .htaccess file and add the following line at the end:

AddType application/xml .xsl

Nginx

If you’re running Nginx, go to your Nginx installation directory and edit mime.types file.

Look for the following line:

    text/xml                              xml;

Change it to:

    text/xml                              xml xsl;

If the above line is absent from the file, add the line below inside types {} block.

    text/xml                              xml xsl;

 

Leave a Reply