<html>
<head>
<script>
function init() {
try {
var objxsd = new ActiveXObject("Msxml2.XMLSchemaCache.5.0");
var objxml = new ActiveXObject("Msxml2.DOMDocument.5.0");
var objxsl = new ActiveXObject("Msxml2.DOMDocument.5.0");
// namespace uri ("urn:books") must be declared as one of the
// namespace delarations in the "books.xml" that is an instance
// of "books.xsd"
objxsd.add("urn:books", "books.xsd");
objxml.schemas = objxsd;
objxml.setProperty("SelectionLanguage", "XPath");
objxml.setProperty("SelectionNamespaces",
"xmlns:ms='urn:schemas-microsoft-com:xslt'");
objxml.async=false;
objxml.validateOnParse=true;
objxml.load("books.xml");
objxsl.async=false;
objxsl.load("books.xsl");
result += "<h2>Used in an XSLT</h2>";
result += objxml.transformNode(objxsl);
document.body.innerHTML = result;
}
catch (e) {
alert(e.description);
}
}
</script>
</head>
<body onload="init()">
</body>
</html>