Compability: Internet Explorer
This method processes this node and its descendants using the specified XSL stylesheet, and returns the resulting transformation.
<script>
xmldoc = new
ActiveXObject("Microsoft.XMLDOM");
xmldoc.async = false;
xmldoc.load("beers.xml");
xsldoc = new
ActiveXObject("Microsoft.XMLDOM");
xsldoc.async = false;
xsldoc.load("beers.xsl");
</script>
<script>
document.write(xmldoc.transformNode(xsldoc));
</script>
This example demonstrates how this method can be used to display the contents of an XML file within an HTML page using an XSL stylesheet. First the code loads both the XML and XSL files, and then the transformNode method is used in conjunction with a document.write to display the contents at the desired place in the HTML document.