Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#1002 Firefox client-side xsl transform, VERSION file mime-type

output: HTML
pending-fixed
XSL (1066)
5
2012-06-02
2008-08-05
No

When Firefox attempts client-side xsl transformation, a mime-type security error is raised due to the naming of
the VERSION file in the root of the docbook-xsl install:

On my Debian box it is: ../nwalsh/VERSION

VERSION is an xsl file, and Firefox complains that the mime-type is not correct for an xsl file due to the missing .xsl file extension. The error message shows in the main browser window as:

**begin error message

Error loading stylesheet:
An XSLT stylesheet does not have an XML mimetype:
http://debnet2/docbook-xsl/VERSION

**end error message

My work-around is to rename /../VERSION to
/../VERSION.xsl and update /../html/docbook.xsl to reflect the name change:

**begin code change

-- <xsl:include href="../VERSION"/>
++ <xsl:include href="../VERSION.xsl"/>

**end code change

The problem occurs in Firefox 2.x, and 3.0 for both windows and linux and probably also affects any other browser that uses the Transformiix xslt engine, i.e., Opera. Happens whether xml is served via apache or opened locally on the server.

Using docbook-xsl version 1.74.0 without any customization aside from the file rename mentioned above. Debian etch, apache 2.2, docbook DTD version 4.4. Happens with any and all requests for client-side transformation using the ../html stylesheets and Firefox. IE seems to ignore the issue at the moment.

Thanks for the great work,

Richard

Discussion

  • error screenshot, Firefox 2.x

     
    Attachments
  • I just tried DocBook-XSL 1.75.2 and Firefox 3.6.8 on Windows XP (locally, no web server involved), and I can't get it to work even if VERSION is changed to VERSION.xsl.
    Firefox reports "Error loading stylesheet: An unknown error has occurred ()". The error console contains a reference to <xsl:include href="../VERSION.xsl"/>, but no other clues.

    Sorry for the very late reply.

     
    • assigned_to: nobody --> bobstayton
     
  • David Cramer
    David Cramer
    2011-10-23

    +1 for changing VERSION to VERSION.xsl.

    Changing VERSION to VERSION.xsl works or me using 1.76.1. I loaded the content from a web server not from the filesystem though. One use case is if you're serving up DocBook source from a vcs (e.g. github) and want to have it transformed in the browser. The xsls have to be coming from the same domain, but otherwise it works fine.

     
  • Robert Stayton
    Robert Stayton
    2012-06-02

    The VERSION file is used in the build scripts, and renaming it looked to be risky as I wasn't sure what other tools might use it. So I modified the build process to copy VERSION to VERSION.xsl and ship both with the distribution. I modified the xsl:import statements to reference VERSION.xsl now, so this issue should be resolved.

     
  • Robert Stayton
    Robert Stayton
    2012-06-02

    • status: open --> pending-fixed