Google Chrome中的xsl:include和xsl:param,带有jQuery转换插件 [英] xsl:include and xsl:param at Google Chrome, with jQuery transform plugin

查看:146
本文介绍了Google Chrome中的xsl:include和xsl:param,带有jQuery转换插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直试图在谷歌浏览器中使用XSL,但没有成功。

我看到Chrome浏览器在XSLT中存在一些错误,其中一个是它不支持xsl:包括。错误可以在这里查看: http://code.google.com/ p / chromium / issues / detail?id = 8441
经过一番调查后,我发现了Daer System的一个新版本的转换插件,它使得xsl:include在Chrome中工作。 / p>

jQuery Transform插件可以从 http:/ /plugins.jquery.com/project/Transform



现在我的问题是:

我在一些xsl模板中使用默认包含,这包括使用传递给顶层的参数。



所以它就像我有 top.xsl 模板声明一个[xsl:param name =param/],我用这个参数与 included.xsl ,第一个与[xsl:include href =included.xsl ]。这适用于Firefox和Internet Explorer,但不适用于Chrome。我在这里看到了一个关于stackoverflow的问题,其中一些人重新编写了插件的webkit修复功能,但是这种方式对xsl:param无效。



任何人都知道在谷歌浏览器中使用[xsl:param]的方式吗?

你的问题在于Google Chrome(= Chromium)不支持 xsl:include

缺少此功能在问题8441:JS中的XSLTProcessor中提出的Chromium项目中引人注目不允许xsl:include for http。看起来问题是由WebKit(Chrome中使用的渲染引擎)中的一些架构问题引起的。由于此问题源于WebKit,因此该错误被标记为WontFix--随着WebKit中的原始问题得到解决,未来将提供修复(希望)。




  1. 等到WebKit / Chrome获得可修复此问题的修补程序为止问题(可能需要很长时间...)

  2. 创建/发现解决此问题的黑客攻击,例如通过模拟 xsl:include 适用于Chrome / Webkit (可能需要大量工作/开发黑客)
  3. 尝试寻找写作方式您的软件不需要此特定的XSL功能(或者在服务器端运行XSL转换)

我的建议:避免在客户端使用xsl:include和xsl:param,除非您愿意放弃跨浏览器兼容性

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?

解决方案

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

这篇关于Google Chrome中的xsl:include和xsl:param,带有jQuery转换插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆