Merge branch 'kill-e4x'
This commit is contained in:
commit
056547f0c0
1 changed files with 5 additions and 2 deletions
|
@ -174,8 +174,8 @@ Zotero.Styles = new function() {
|
||||||
var parser = Components.classes["@mozilla.org/xmlextras/domparser;1"]
|
var parser = Components.classes["@mozilla.org/xmlextras/domparser;1"]
|
||||||
.createInstance(Components.interfaces.nsIDOMParser),
|
.createInstance(Components.interfaces.nsIDOMParser),
|
||||||
doc = parser.parseFromString(style, "application/xml");
|
doc = parser.parseFromString(style, "application/xml");
|
||||||
if (!doc.documentElement.localName) {
|
if(doc.documentElement.localName === "parsererror") {
|
||||||
throw new Error("File is not XML");
|
throw new Error("File is not valid XML");
|
||||||
}
|
}
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
error = e;
|
error = e;
|
||||||
|
@ -367,6 +367,9 @@ Zotero.Style = function(arg) {
|
||||||
parser = Components.classes["@mozilla.org/xmlextras/domparser;1"]
|
parser = Components.classes["@mozilla.org/xmlextras/domparser;1"]
|
||||||
.createInstance(Components.interfaces.nsIDOMParser),
|
.createInstance(Components.interfaces.nsIDOMParser),
|
||||||
doc = parser.parseFromString(style, "application/xml");
|
doc = parser.parseFromString(style, "application/xml");
|
||||||
|
if(doc.documentElement.localName === "parsererror") {
|
||||||
|
throw new Error("File is not valid XML");
|
||||||
|
}
|
||||||
|
|
||||||
this.styleID = Zotero.Utilities.xpathText(doc, '/csl:style/csl:info[1]/csl:id[1]',
|
this.styleID = Zotero.Utilities.xpathText(doc, '/csl:style/csl:info[1]/csl:id[1]',
|
||||||
Zotero.Styles.ns);
|
Zotero.Styles.ns);
|
||||||
|
|
Loading…
Reference in a new issue