Statistiques
| Révision :

root / TXM / trunk / org.txm.rcp.updatesite / index.html @ 3618

Historique | Voir | Annoter | Télécharger (1,97 ko)

1 3618 mdecorde
<html>
2 3618 mdecorde
<head>
3 3618 mdecorde
<title>org.txm.rcp.updatesite</title>
4 3618 mdecorde
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 3618 mdecorde
<style>@import url("web/site.css");</style>
6 3618 mdecorde
<script type="text/javascript">
7 3618 mdecorde
        var returnval = 0;
8 3618 mdecorde
        var stylesheet, xmlFile, cache, doc;
9 3618 mdecorde
        function init(){
10 3618 mdecorde
                // NSCP 7.1+ / Mozilla 1.4.1+ / Safari
11 3618 mdecorde
                // Use the standard DOM Level 2 technique, if it is supported
12 3618 mdecorde
                if (document.implementation && document.implementation.createDocument) {
13 3618 mdecorde
                        xmlFile = document.implementation.createDocument("", "", null);
14 3618 mdecorde
                        stylesheet = document.implementation.createDocument("", "", null);
15 3618 mdecorde
                        if (xmlFile.load){
16 3618 mdecorde
                                xmlFile.load("site.xml");
17 3618 mdecorde
                                stylesheet.load("web/site.xsl");
18 3618 mdecorde
                        } else {
19 3618 mdecorde
                                alert("Document could not be loaded by browser.");
20 3618 mdecorde
                        }
21 3618 mdecorde
                        xmlFile.addEventListener("load", transform, false);
22 3618 mdecorde
                        stylesheet.addEventListener("load", transform, false);
23 3618 mdecorde
                }
24 3618 mdecorde
                //IE 6.0+ solution
25 3618 mdecorde
                else if (window.ActiveXObject) {
26 3618 mdecorde
                        xmlFile = new ActiveXObject("msxml2.DOMDocument.3.0");
27 3618 mdecorde
                        xmlFile.async = false;
28 3618 mdecorde
                        xmlFile.load("site.xml");
29 3618 mdecorde
                        stylesheet = new ActiveXObject("msxml2.FreeThreadedDOMDocument.3.0");
30 3618 mdecorde
                        stylesheet.async = false;
31 3618 mdecorde
                        stylesheet.load("web/site.xsl");
32 3618 mdecorde
                        cache = new ActiveXObject("msxml2.XSLTemplate.3.0");
33 3618 mdecorde
                        cache.stylesheet = stylesheet;
34 3618 mdecorde
                        transformData();
35 3618 mdecorde
                }
36 3618 mdecorde
        }
37 3618 mdecorde
        // separate transformation function for IE 6.0+
38 3618 mdecorde
        function transformData(){
39 3618 mdecorde
                var processor = cache.createProcessor();
40 3618 mdecorde
                processor.input = xmlFile;
41 3618 mdecorde
                processor.transform();
42 3618 mdecorde
                data.innerHTML = processor.output;
43 3618 mdecorde
        }
44 3618 mdecorde
        // separate transformation function for NSCP 7.1+ and Mozilla 1.4.1+
45 3618 mdecorde
        function transform(){
46 3618 mdecorde
                returnval+=1;
47 3618 mdecorde
                if (returnval==2){
48 3618 mdecorde
                        var processor = new XSLTProcessor();
49 3618 mdecorde
                        processor.importStylesheet(stylesheet);
50 3618 mdecorde
                        doc = processor.transformToDocument(xmlFile);
51 3618 mdecorde
                        document.getElementById("data").innerHTML = doc.documentElement.innerHTML;
52 3618 mdecorde
                }
53 3618 mdecorde
        }
54 3618 mdecorde
</script>
55 3618 mdecorde
</head>
56 3618 mdecorde
<body onload="init();">
57 3618 mdecorde
<!--[insert static HTML here]-->
58 3618 mdecorde
<div id="data"><!-- this is where the transformed data goes --></div>
59 3618 mdecorde
</body>
60 3618 mdecorde
</html>