如何使XSLT在Chrome中工作? [英] How can I make XSLT work in chrome?
问题描述
我有一个XML文档此处与相应的 XSL文件。这个转换留在客户端执行,没有JavaScript。
这在IE(惊悚)中效果很好,但在Google Chrome中,只显示文档的文本节点。
我知道在Chrome中可以使用客户端XSL,就像我看过它的例子,但我仍然无法复制这个成功我自己
我做错了什么? 当时写作时,出现 Chrome中的错误, code> xmlns 属性以触发呈现:
< xsl:stylesheet xmlns =http://www.w3.org/1999/xhtml...>
这是从服务器提供xml文件时遇到的问题 em>。
如果不同于我,您正在查看xml文件一个 file:///
url ,那么提到的解决方案 - 允许从文件访问文件
是你想要的
I have an XML document here that is served with a corresponding XSL file. The transformation is left to be executed client-side, without JavaScript.
This works fine in IE (shock horror), but in Google Chrome, just displays the document's text nodes.
I know that it is possible to do client-side XSL in Chrome, as I have seen examples of it, but I am yet to be able to replicate this success myself
What am I doing wrong?
At the time of writing, there was a bug in chrome which required an xmlns
attribute in order to trigger rendering:
<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml" ... >
This was the problem I was running into when serving the xml file from a server.
If unlike me, you are viewing the xml file from a file:///
url, then the solutions mentioning --allow-file-access-from-files
are the ones you want
这篇关于如何使XSLT在Chrome中工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!