加載XML和XSLT無法在IE11中轉換它之後。
同時改造我越來越Object doesn't support property or method transformNode
將內聯XML和內聯XSL轉換爲XHTML
<!DOCTYPE html>
<html>
<head>
<title>XML Data Block Demo</title>
<script id="GUI" type="application/xml">
<GUI>
<option>
<name>My Inbox</name>
</option>
<option>
<name>My Home</name>
</option>
</GUI>
</script>
<script id="GUIxsl" type="application/xml">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<h2>GUI</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th style="text-align:left">Option</th>
</tr>
<xsl:for-each select="GUI/option">
<tr>
<td><xsl:value-of select="name"/></td>
</tr>
</xsl:for-each>
</table>
</xsl:template>
</xsl:stylesheet>
</script>
<script>
function loadOnPage() {
debugger;
var xml = document.getElementById("GUI").textContent;
var xsl = document.getElementById("GUIxsl").textContent;
var parser = new DOMParser();
var docxml = parser.parseFromString(xml, "application/xml");
var docxsl = parser.parseFromString(xsl, "application/xml");
ex = docxml.transformNode(docxsl);
document.getElementById("example").innerHTML = ex;
}
</script>
</head>
<body onload="loadOnPage()";>
<div id="example" />
Demo did not run
</body>
</html>
https://www.w3schools.com/xml/xsl_client.asp示例 – Premraj