1 <html> <head> <script type=
"text/javascript">
3 function transformXml(xmlurl
, xslturl
, nodeid
){
6 // First try to use the Internet-Explorer method.
7 // If this fails, an exception will be thrown and we
8 // will test the Mozilla method instead.
9 var xslt
= new ActiveXObject("Msxml2.XSLTemplate");
12 var xslDoc
= new ActiveXObject("Msxml2.FreeThreadedDOMDocument");
14 xslDoc
.resolveExternals
= false;
16 // alert( "Stylesheet loaded" );
17 xslt
.stylesheet
= xslDoc
;
20 var xmlDoc
= new ActiveXObject("Msxml2.DOMDocument");
22 xmlDoc
.resolveExternals
= false;
23 xmlDoc
.validateOnParse
= false;
25 // alert( "Xml loaded" );
27 var xslProc
= xslt
.createProcessor();
28 xslProc
.input
= xmlDoc
;
29 // xslProc.addParameter("subj", subject);
31 document
.getElementById(nodeid
).innerHTML
= xslProc
.output
;
36 var xsltProcessor
= new XSLTProcessor();
40 var myXMLHTTPRequest
= new XMLHttpRequest();
41 myXMLHTTPRequest
.open("GET", xslturl
, false);
42 myXMLHTTPRequest
.send(null);
44 xslStylesheet
= myXMLHTTPRequest
.responseXML
;
45 xsltProcessor
.importStylesheet(xslStylesheet
);
48 myXMLHTTPRequest
= new XMLHttpRequest();
49 myXMLHTTPRequest
.open("GET", xmlurl
, false);
50 myXMLHTTPRequest
.send(null);
51 xmlDoc
= myXMLHTTPRequest
.responseXML
;
53 // xsltProcessor.setParameter(null,"subj",subject);
54 // ATTENTION if you get interesting errors in the next line
55 // check if your webserver is sending the x-gzip encoding
56 // correctly! (Apache needs AddEncoding and must not have anything
57 // else relating to .gz files)
58 var fragment
= xsltProcessor
.transformToFragment(xmlDoc
,document
);
59 document
.getElementById(nodeid
).innerHTML
= "";
61 document
.getElementById(nodeid
).appendChild(fragment
);
69 function loadListing()
71 var file
= document
.location
.search
.substring(1);
73 document
.getElementById('heading').innerHTML
= file
;
75 listingUrl
= "http://" + document
.location
.host
+ "/xmltv/" + file
+ ".xml.gz"
76 transformXml( listingUrl
, 'listing.xsl', 'listing' );
81 <style type=
"text/css">
82 .startdate { display: none
; }
83 .enddate { display: none
; }
87 <body onload=
"loadListing()">
89 <h2><span id=
"heading"></span></h2>