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