-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathindex.html
87 lines (83 loc) · 2.51 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<html>
<head>
<title>Enhanced Class Decompiler Project Update</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style>@import url("site.css");</style>
<script type="text/javascript">
var stylesheet, xmlFile, cache, doc;
function init(){
var xml = loadXMLDoc("site.xml");
var xsl = loadXMLDoc("site.xsl");
if (window.ActiveXObject || "ActiveXObject" in window){
try{
document.getElementById("data").innerHTML = xml.transformNode(xsl.documentElement);
}
catch(e){
displayAtIE6Plus();
}
}
else if (window.ActiveXObject){
displayAtIE6Plus();
}
else if (document.implementation && document.implementation.createDocument)
{
var processor = new XSLTProcessor();
processor.importStylesheet(xsl);
doc = processor.transformToDocument(xml);
document.getElementById("data").innerHTML = doc.documentElement.innerHTML;
}
}
function displayAtIE6Plus(){
xmlFile = new ActiveXObject("msxml2.DOMDocument.3.0");
xmlFile.async = false;
xmlFile.load("site.xml");
stylesheet = new ActiveXObject("msxml2.FreeThreadedDOMDocument.3.0");
stylesheet.async = false;
stylesheet.load("site.xsl");
cache = new ActiveXObject("msxml2.XSLTemplate.3.0");
cache.stylesheet = stylesheet;
transformData();
}
function loadXMLDoc(url) {
if (typeof XMLHttpRequest !== 'undefined')
{
var xhr = new XMLHttpRequest();
xhr.open('GET', url, false);
try { xhr.responseType = 'msxml-document'; } catch(e){}
xhr.send();
return xhr.responseXML;
}
else {
try {
var xhr = new ActiveXObject('Msxml2.XMLHTTP.3.0');
xhr.open('GET', url, false);
xhr.send();
return xhr.responseXML;
}
catch (e) {}
}
}
// separate transformation function for IE 6.0+
function transformData(){
var processor = cache.createProcessor();
processor.input = xmlFile;
processor.transform();
data.innerHTML = processor.output;
}
// separate transformation function for NSCP 7.1+ and Mozilla 1.4.1+
function transform(){
returnval+=1;
if (returnval==2){
var processor = new XSLTProcessor();
processor.importStylesheet(stylesheet);
doc = processor.transformToDocument(xmlFile);
document.getElementById("data").innerHTML = doc.documentElement.innerHTML;
}
}
</script>
</head>
<body onload="init();">
<!--[insert static HTML here]-->
<div id="data"><!-- this is where the transformed data goes --></div>
</body>
</html>