Skip to content
Permalink
Browse files

Remove old style conversion code

  • Loading branch information...
adomasven committed Sep 26, 2018
1 parent e57e297 commit a59ce2c343ee5aacdb5f731d7264a0e9273a2f70
Showing with 1 addition and 29 deletions.
  1. +1 −29 chrome/content/zotero/xpcom/style.js
@@ -713,35 +713,7 @@ Zotero.Style.prototype.getCiteProc = function(locale, automaticJournalAbbreviati
} else {
var version = this._version;
}

if(version === "0.8") {
// get XSLT processor from updateCSL.xsl file
if(!Zotero.Styles.xsltProcessor) {
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", channel.contentLength, "application/xml");

// load XSLT file into XSLTProcessor
Zotero.Styles.xsltProcessor = Components.classes["@mozilla.org/document-transformer;1?type=xslt"]
.createInstance(Components.interfaces.nsIXSLTProcessor);
Zotero.Styles.xsltProcessor.importStylesheet(updateXSLT);
}

// read style file as DOM XML
let styleDOMXML = Components.classes["@mozilla.org/xmlextras/domparser;1"]
.createInstance(Components.interfaces.nsIDOMParser)
.parseFromString(this.getXML(), "text/xml");

// apply XSLT and serialize output
let newDOMXML = Zotero.Styles.xsltProcessor.transformToDocument(styleDOMXML);
var xml = Components.classes["@mozilla.org/xmlextras/xmlserializer;1"]
.createInstance(Components.interfaces.nsIDOMSerializer).serializeToString(newDOMXML);
} else {
var xml = this.getXML();
}
var xml = this.getXML();

try {
var citeproc = new Zotero.CiteProc.CSL.Engine(

0 comments on commit a59ce2c

Please sign in to comment.
You can’t perform that action at this time.