Fix xml/dom mode, part 2

This commit is contained in:
Simon Kornblith 2012-07-01 15:43:47 -04:00
parent 4b498570c0
commit f369af268d

View file

@ -467,7 +467,13 @@ Zotero.Translate.IO.Read.prototype = {
"_getXML":function() {
if(this._mode == "xml/dom") {
return Zotero.Translate.IO.parseDOMXML(this._rawStream, this._charset, this.file.fileSize);
try {
var xml = Zotero.Translate.IO.parseDOMXML(this._rawStream, this._charset, this.file.fileSize);
} catch(e) {
this._xmlInvalid = true;
throw e;
}
return (Zotero.isFx5 ? Zotero.Translate.SandboxManager.Fx5DOMWrapper(xml) : xml);
} else {
return this._readToString().replace(/<\?xml[^>]+\?>/, "");
}