Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xsl:include and xsl:param at Google Chrome, with jQuery transform plugin

I've been trying to use XSL with Google Chrome, but with no success.
I read that Chrome have some bugs with XSLT, and one of them is that it doesn't support xsl:include. Bug can be checked here: http://code.google.com/p/chromium/issues/detail?id=8441.
After some research I found a new version of the transform plugin by Daer System, and it makes xsl:include work at Chrome.

jQuery Transform plugin can be found from http://plugins.jquery.com/project/Transform

Now my problem is:
I use a default include in some xsl templates, and this include uses a parameter that is passed to the top level one.

So its like i have the top.xsl template that declares a [xsl:param name="param" /], and i use this param with the included.xsl, that is called by the 1st one with [xsl:include href="included.xsl"] . This works both on Firefox and Internet Explorer, but not on Chrome. I saw a question here on stackoverflow where some guy re-write the webkit fix function from the plugin, but it doesn't work with xsl:param this way.

Does anyone know some way to use [xsl:param] like this in Google Chrome?

like image 410
Bruno Campos Avatar asked Sep 06 '10 18:09

Bruno Campos


1 Answers

Your problem here is that Google Chrome (=Chromium) does not support xsl:include

The lack of this feature is well noted in the Chromium project as raised in "Issue 8441: XSLTProcessor in JS does not permit xsl:include for http". It seems that the problem is caused by some architectural problem in WebKit (the rendering engine used in Chrome). Since this problem originates to WebKit, the bug is marked as WontFix -- the fix will be provided (hopefully) in the future as the original problem in the WebKit is getting resolved.

I see three possible alternatives of how this problem could be resolved for you:

  1. Wait until WebKit/Chrome gets a patch that fixes this problem (potentially takes a long time...)
  2. Create/find a hack that works around this problem for instance by emulating somehow xsl:include for Chrome/Webkit (potentially requires a lot of work / developing a hack)
  3. Try to find a way writing your software in a way that you don't require this specific XSL feature (alternatively run XSL transformation in server-side)

My recommendation: avoid using xsl:include with xsl:param on client side unless you are willing to give up on cross-browser compatibility

like image 113
jsalonen Avatar answered Oct 10 '22 00:10

jsalonen