commit ac927f090dfcb3e6944100f159f0ac5030564aac
parent 4278d607107a300b75b7b241e4844d54ac8693cd
Author: Dan Stillman <dstillman@zotero.org>
Date: Sun, 20 Sep 2009 01:58:02 +0000
Fix CrossRef translator on some DOIs with different namespace
Diffstat:
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/translators/CrossRef.js b/translators/CrossRef.js
@@ -8,7 +8,7 @@
"maxVersion":"",
"priority":90,
"inRepository":true,
- "lastUpdated":"2009-09-18 01:05:00"
+ "lastUpdated":"2009-09-20 02:00:00"
}
function detectSearch(item) {
@@ -40,10 +40,15 @@ function processCrossRef(xmlOutput) {
// "with ({});" needed to fix default namespace scope issue
// See https://bugzilla.mozilla.org/show_bug.cgi?id=330572
- default xml namespace = "http://www.crossref.org/xschema/1.0"; with ({});
+ default xml namespace = "http://www.crossref.org/xschema/1.1"; with ({});
- // ensure status is valid
- if(!xml.doi_record.length()) return false;
+ if(!xml.doi_record.length()) {
+ // Fall back to older namespace
+ default xml namespace = "http://www.crossref.org/xschema/1.0";
+ if(!xml.doi_record.length()) {
+ return false;
+ }
+ }
// ensure this isn't an error
if(xml.doi_record.crossref.error.length()) {
throw xml.doi_record.crossref.error