2 Replies Latest reply on Dec 21, 2005 8:17 PM by Kendy Yus

    add xsl mime type on jboss2.4.4-tomcat3

    Kendy Yus Newbie

      Hi,
      I have a servlet that return xml content to the browser and have a xsl stylesheet. The xml content is displayed nicely under Internet Explorer, but on Mozilla browser I get this error:
      "Error loading stylesheet: An XSLT stylesheet does not have an XML mimetype:"
      (I am using jboss2.4.4-Tomcat3.)
      So, I've added the mimetypes on /tomcat/conf/web.xml these entries:
      <mime-mapping>
      xml
      <mime-type>
      application/xml
      </mime-type>
      </mime-mapping>
      <mime-mapping>
      xsl
      <mime-type>
      application/xml
      </mime-type>
      </mime-mapping>
      <mime-mapping>
      xslt
      <mime-type>text/xslt</mime-type>
      </mime-mapping>
      as suggested by some discussion I read, since I get it work on mozilla locally from an xml file.

      My xml generated has this header:
      <?xml version="1.0" encoding="ISO-8859-1" ?><?xml-stylesheet type="text/xsl" href="document.xsl"?>

      My xsl stylesheet has this header:
      <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

      Anyone has any idea?

        • 1. Re: add xsl mime type on jboss2.4.4-tomcat3
          kevinstembridge Newbie

          I'm getting the same error and one workaround I've found that works is to rename the stylesheet documents to have an xml extension. document.xsl becomes something like document-xsl.xml.

          If you managed to come up with a better solution I'd love to hear it because I'm having to manually modify the files generated by third party software. I'd prefer it if I could just configure JBoss or Firefox to load them correctly.

          • 2. Re: add xsl mime type on jboss2.4.4-tomcat3
            Kendy Yus Newbie

            I've changed the stylesheet to have .xml extension. But the result is still the same. It works fine on IE, but on Mozilla Firefox, it says:
            "Error loading stylesheet: An XSLT stylesheet does not have an XML mimetype:"
            I don't understand why it doesn't work, since I have configured jboss to recognize mime type .xsl and also .xml.