Re: [xsl] [XSL] XSL Browser Integration

Subject: Re: [xsl] [XSL] XSL Browser Integration
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Sun, 16 Sep 2007 20:06:15 +0200
M. David Peterson wrote:


* There are some gotchas.
* Abel Braaksma has become the resident expert of what these gotchas are as they relate to each of the four major browsers.
* I'd bet if you asked nicely he would either point you to the various related threads from months and years past and/or summarize them for you in-line to this thread. ;-)

haha, thanks M:D, let's pick up that gauntlet ;) . Here's one of them that I find particularly annoying: If you use XHR for getting your XML for your XSLT files, and when you are on the (in)famous IE browser, than you need to serialize-reparse the stream into a freethreaded DOM document for it to be usable as an XSLT processor DOM source.


This, of course, is a costly operation (but not nearly as costly for the XML DOM that is usually quite bigger). But the annoying bit is: you'll loose your base href.when you reparse. I have posted a fix for this to the Sarissa list that can be used to use the document() / xsl:import/include statements without expensive modifications (one could argue to give the base-href as a param, but that won't work for xsl:import/include). The fix is nothing more than a quite complex regular expression and adds the real base-href to paths using normal xpath syntax.

This problem does not arise when you load your documents directly from a http source.

But let this not withhold you from using client side transformations. Since I do that, most of the time I don't have to deal with cross-browser troubles and that speeds up my development process tremendously (and it forces me to use a better MVC like design).

Cheers,
-- Abel Braaksma

Current Thread