Wednesday, 14 May 2008

XSLT in the browser

XSLT in the browser, its original motivating use case, has had a somewhat difficult time, but with support finally appearing in Opera and Safari, and the support in IE and Firefox/mozilla being fairly stable it looked like perhaps its time had come (even if stuck in an XSLT 1 era).

But then came Firefox 3 beta 5.....

Firefox has decided that relative links that traverse the filesystem out of the current directory are a security error. They are (pretty confusingly) reported as XML parse error rather than a security error.

https://bugzilla.mozilla.org/show_bug.cgi?id=427333

This is pretty fatal to browsing XML files on the filesystem, at NAG for instance, the documentation is distributed as a directory tree of a few thousand XML files, at the top level is a styles directory and so the individual files have xml-stylesheet links linking to ../../styles/foo.xsl or whatever is needed. This works in all browsers that support XSLT at all, except firefox 3 beta 5. Where apparently the only solution is to change the link to href="foo.xsl" and then copy the stylesheet into dozens of directories. Blurgh....

I hope bug 427333 gets fixed before FF3 gets out of beta....

Update: ../ stylesheets work again in FF3 release candidate 1, yipee!