[OPEN-ILS-DEV] Staff Client z39.50 MARC view

Grant Johnson fgjohnson at upei.ca
Wed May 27 15:34:18 EDT 2009


I'm almost positive I have this update....

<html>
<head>
<style type='text/css'
.marc_subfield_code { color: blue; padding-left: 5px; padding-right: 5px }
</style>
<script type='text/javascript' src="/xul/rel_1_4_0_4/server/main/constants.js"></script>
<script type='text/javascript'>
<![CDATA[

	var xsltProcessor;

	function xsl_marc2html_init() {
        try {
    		netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
    		xsltProcessor = new XSLTProcessor();
    		var req = new XMLHttpRequest();
    		req.open("GET", urls.xsl_marc2html, false);
    		req.send(null);
            if (req.status != 200) {
                alert('We were unable to load ' + urls.xsl_marc2html + ' and thus cannot display the MARC here.\nReason: ' + req.statusText);
                return false;
            }
    		var xsl = req.responseXML;
    		xsltProcessor.importStylesheet(xsl);
            return true;
        } catch(E) {
            alert('An error occurred and we are unable to display the MARC here.\nError in xsl_marc2html_init: ' + E);
            return false;
        }
	}

	function apply_xsl_marc2html(marc) {
        try {
    		netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
            var obj = this;
            var parser = new DOMParser();
            var doc = parser.parseFromString( marc, 'text/xml' );
            var node = doc.documentElement;
            var fragment = xsltProcessor.transformToFragment(node, document);
            document.body.appendChild(fragment);
        } catch(E) {
            alert('An error occurred and we are unable to display the MARC here.\nError in apply_xsl_marc2html: ' + E);
        }
	}

	function my_init() {
		if (!xsl_marc2html_init()) return;
		document.body.innerHTML = "<button onclick='window.print()'>Print Page</button>";
		if (typeof xulG != 'undefined' && xulG.marcxml) apply_xsl_marc2html(xulG.marcxml);
		document.body.firstChild.focus();
	}

]]>
</script>
</head>
<body onload="try { my_init(); } catch(E) { alert(E); }">
</body>
</html>

>>> On 5/27/2009 at 3:37 PM, in message
<1f3c053e0905271137n48d2db4awa89771b293602133 at mail.gmail.com>, Jason Etheridge
<jason at esilibrary.com> wrote:
>>         "message":"f.my_init is not a function",
> 
> Grant, I'm almost certain this is caused by XMLENT mangling the html file.
> 
> See this thread: http://markmail.org/message/5f3p3fspb3kdbomp



More information about the Open-ils-dev mailing list