3 <style type='text/css'>
4 .marc_subfield_code { color: blue; padding-left: 5px; padding-right: 5px }
6 <script type='text/javascript' src='/xul/server/main/constants.js'></script>
7 <script type='text/javascript'>
12 function xsl_marc2html_init() {
14 xsltProcessor = new XSLTProcessor();
15 var req = new XMLHttpRequest();
16 req.open("GET", urls.xsl_marc2html, false);
18 if (req.status != 200) {
19 alert('We were unable to load ' + urls.xsl_marc2html + ' and thus cannot display the MARC here.\nReason: ' + req.statusText);
22 var xsl = req.responseXML;
23 xsltProcessor.importStylesheet(xsl);
26 alert('An error occurred and we are unable to display the MARC here.\nError in xsl_marc2html_init: ' + E);
31 function apply_xsl_marc2html(marc) {
34 var parser = new DOMParser();
35 var doc = parser.parseFromString( marc, 'text/xml' );
36 var node = doc.documentElement;
37 var fragment = xsltProcessor.transformToFragment(node, document);
38 document.body.appendChild(fragment);
40 alert('An error occurred and we are unable to display the MARC here.\nError in apply_xsl_marc2html: ' + E);
45 if (!xsl_marc2html_init()) return;
46 document.body.innerHTML = "<button onclick='window.print()'>Print Page<\/button>";
47 if (typeof xulG != 'undefined' && xulG.marcxml) apply_xsl_marc2html(xulG.marcxml);
48 document.body.firstChild.focus();
54 <body onload="try { my_init(); } catch(E) { alert(E); }">