在没有服务器的情况下将XSLT本地应用到XML

时间:2018-07-05 14:56:46

标签: javascript xml xslt xmlhttprequest client

我有一堆XML文件,我想用html和javascript为它们创建一个本地浏览器,在其中可以使用按钮nextprevious浏览将XSLT应用于XML。

[previous]  [next]
 _______________
|               |
|   Result of   |
| applying XSLT | 
|    on XML     |
|               |
 ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅

我遵循了XSLT - On the Client @ w3school上的说明

它适用于Firefox,但不适用于Chromium:

Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.

xhttp.open("GET", filename, false);
try {xhttp.responseType = "msxml-document"} catch(err) {} // Helping IE11
xhttp.send(""); //**Causes the Error**

如何跨浏览器进行这项工作? 我想即时获取html文件,而不是生成它们并保留XML。

0 个答案:

没有答案
相关问题