Fix errors auto-detecting import formats
This commit is contained in:
parent
df7308e863
commit
e3e8881282
1 changed files with 7 additions and 5 deletions
|
@ -1135,7 +1135,7 @@ Zotero.Translate.prototype._reportTranslationFailure = function(errorData) {
|
||||||
Zotero.Translate.prototype._closeStreams = function() {
|
Zotero.Translate.prototype._closeStreams = function() {
|
||||||
// serialize RDF and unregister dataSource
|
// serialize RDF and unregister dataSource
|
||||||
if(this._rdf) {
|
if(this._rdf) {
|
||||||
if(this._streams.length) {
|
if(this.type == "export" && this._streams.length) {
|
||||||
// initialize serializer and add prefixes
|
// initialize serializer and add prefixes
|
||||||
var serializer = Serializer();
|
var serializer = Serializer();
|
||||||
for(var prefix in this._rdf.namespaces) {
|
for(var prefix in this._rdf.namespaces) {
|
||||||
|
@ -1823,11 +1823,11 @@ Zotero.Translate.prototype._importDoneSniffing = function(charset) {
|
||||||
Zotero.Translate.prototype._importConfigureIO = function(charset) {
|
Zotero.Translate.prototype._importConfigureIO = function(charset) {
|
||||||
if(this.configOptions.dataMode && (this.configOptions.dataMode == "rdf" || this.configOptions.dataMode == "rdf/n3")) {
|
if(this.configOptions.dataMode && (this.configOptions.dataMode == "rdf" || this.configOptions.dataMode == "rdf/n3")) {
|
||||||
if(!this._rdf) {
|
if(!this._rdf) {
|
||||||
Zotero.debug("initializing data store");
|
Zotero.debug("Translate: initializing data store");
|
||||||
// initialize data store
|
// initialize data store
|
||||||
this._rdf = new Zotero.RDF.AJAW.RDFIndexedFormula();
|
this._rdf = new Zotero.RDF.AJAW.RDFIndexedFormula();
|
||||||
|
|
||||||
Zotero.debug("loading data");
|
Zotero.debug("Translate: loading data");
|
||||||
// load data into store
|
// load data into store
|
||||||
var IOService = Components.classes['@mozilla.org/network/io-service;1']
|
var IOService = Components.classes['@mozilla.org/network/io-service;1']
|
||||||
.getService(Components.interfaces.nsIIOService);
|
.getService(Components.interfaces.nsIIOService);
|
||||||
|
@ -1849,8 +1849,10 @@ Zotero.Translate.prototype._importConfigureIO = function(charset) {
|
||||||
xmlhttp.send("");
|
xmlhttp.send("");
|
||||||
|
|
||||||
var nodeTree = xmlhttp.responseXML;
|
var nodeTree = xmlhttp.responseXML;
|
||||||
|
if(nodeTree.getElementsByTagName("parsererror").length) {
|
||||||
Zotero.debug(xmlhttp.responseText)
|
this._rdf = false;
|
||||||
|
throw("RDF/XML parse error; loading data into data store failed");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var parser = new Zotero.RDF.AJAW.RDFParser(this._rdf);
|
var parser = new Zotero.RDF.AJAW.RDFParser(this._rdf);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue