From ca0328729affa4b468e45e68b2066d84ee28df30 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Tue, 6 Jul 2010 18:39:49 +0000 Subject: [PATCH] addresses #1691, Update Zotero.QuickCopy.getContentFromItems() for new citation API fix up problems on first drag --- chrome/content/zotero/xpcom/style.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/chrome/content/zotero/xpcom/style.js b/chrome/content/zotero/xpcom/style.js index 7b6ee98490..28453145e5 100644 --- a/chrome/content/zotero/xpcom/style.js +++ b/chrome/content/zotero/xpcom/style.js @@ -396,11 +396,12 @@ function() { if(this._version == "0.8") { // get XSLT processor from updateCSL.xsl file if(!Zotero.Styles.xsltProcessor) { - let xhr = Components.classes["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance(); - xhr.open("GET", "chrome://zotero/content/updateCSL.xsl", false); - xhr.overrideMimeType("text/xml"); - xhr.send(); - let updateXSLT = xhr.responseXML; + let protHandler = Components.classes["@mozilla.org/network/protocol;1?name=chrome"] + .createInstance(Components.interfaces.nsIProtocolHandler); + let channel = protHandler.newChannel(protHandler.newURI("chrome://zotero/content/updateCSL.xsl", "UTF-8", null)); + let updateXSLT = Components.classes["@mozilla.org/xmlextras/domparser;1"] + .createInstance(Components.interfaces.nsIDOMParser) + .parseFromStream(channel.open(), "UTF-8", 32768, "application/xml"); // load XSLT file into XSLTProcessor Zotero.Styles.xsltProcessor = Components.classes["@mozilla.org/document-transformer;1?type=xslt"]