diff --git a/chrome/content/zotero/xpcom/translation/browser_firefox.js b/chrome/content/zotero/xpcom/translation/browser_firefox.js index 9c0ea70bb..dc54da315 100644 --- a/chrome/content/zotero/xpcom/translation/browser_firefox.js +++ b/chrome/content/zotero/xpcom/translation/browser_firefox.js @@ -238,7 +238,7 @@ Zotero.Translate.IO.Read = function(file, mode) { } Zotero.Translate.IO.Read.prototype = { - "__exposedProps__":["getXML", "RDF", "read", "setCharacterSet"], + "__exposedProps__":["_getXML", "RDF", "read", "setCharacterSet"], "_seekToStart":function() { this._rawStream.QueryInterface(Components.interfaces.nsISeekableStream) @@ -309,11 +309,11 @@ Zotero.Translate.IO.Read.prototype = { } }, - "getXML":function() { + "_getXML":function() { if(this._mode == "xml/dom") { return Zotero.Translate.IO.parseDOMXML(this._rawStream, this._charset, this.file.fileSize); } else { - return new XML(this._readToString().replace(/<\?xml[^>]+\?>/, "")); + return this._readToString().replace(/<\?xml[^>]+\?>/, ""); } }, diff --git a/chrome/content/zotero/xpcom/translation/translate.js b/chrome/content/zotero/xpcom/translation/translate.js index 75a1be9f4..d4f06ef5b 100644 --- a/chrome/content/zotero/xpcom/translation/translate.js +++ b/chrome/content/zotero/xpcom/translation/translate.js @@ -814,7 +814,10 @@ Zotero.Translate.Base.prototype = { "};"+ "Zotero.Item.prototype.complete = function() { Zotero._itemDone(this); };"+ "Zotero.Collection = function () {};"+ - "Zotero.Collection.prototype.complete = function() { Zotero._collectionDone(this); };"); + "Zotero.Collection.prototype.complete = function() { Zotero._collectionDone(this); };"+ + // https://bugzilla.mozilla.org/show_bug.cgi?id=609143 - can't pass E4X to sandbox in Fx4 + "Zotero.getXML = function() { return new XML(Zotero._getXML()); }" + ); this._sandboxManager.importObject(this.Sandbox, this); this._sandboxManager.importObject({"Utilities":new Zotero.Utilities.Translate(this)}); @@ -1312,7 +1315,7 @@ Zotero.Translate.IO.String = function(string, uri, mode) { } Zotero.Translate.IO.String.prototype = { - "__exposedProps__":["getXML", "RDF", "read", "write", "setCharacterSet", "getXML"], + "__exposedProps__":["RDF", "read", "write", "setCharacterSet", "_getXML"], "_initRDF":function() { Zotero.debug("Translate: Initializing RDF data store"); @@ -1375,11 +1378,11 @@ Zotero.Translate.IO.String.prototype = { this.string.length += data.length; }, - "getXML":function() { + "_getXML":function() { if(this._mode == "xml/dom") { return Zotero.Translate.IO.parseDOMXML(this.string); } else { - return new XML(this.string.replace(/<\?xml[^>]+\?>/, "")); + return this.string.replace(/<\?xml[^>]+\?>/, ""); } }, diff --git a/translators/MODS.js b/translators/MODS.js index f2db51a51..eb282875d 100644 --- a/translators/MODS.js +++ b/translators/MODS.js @@ -508,7 +508,7 @@ function doImport() { } // try to get genre from local genre for each(var genre in mods.m::genre) { - if(genre.@authority == "local" && Zotero.Utilities.itemTypeExists(genre)) { + if(genre.@authority == "local" && Zotero.Utilities.itemTypeExists(genre.text().toString())) { newItem.itemType = genre.text().toString(); } else if(!newItem.itemType && (genre.@authority == "marcgt" || genre.@authority == "marc")) { // otherwise, look at the marc genre