From ac927f090dfcb3e6944100f159f0ac5030564aac Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sun, 20 Sep 2009 01:58:02 +0000 Subject: [PATCH] Fix CrossRef translator on some DOIs with different namespace --- translators/CrossRef.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/translators/CrossRef.js b/translators/CrossRef.js index 2de5d9006b..e1a7d9cdf1 100644 --- 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