From 385cb2f0b44a5b18ca3676b348ccff222819f37f Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 18 Sep 2009 01:01:59 +0000 Subject: [PATCH] Fix CrossRef translator (CrossRef added a namespace) --- repotime.txt | 2 +- translators/CrossRef.js | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/repotime.txt b/repotime.txt index 4f5598471..9f1aad39e 100644 --- a/repotime.txt +++ b/repotime.txt @@ -1 +1 @@ -2009-08-04 04:40:00 +2009-09-18 01:05:00 diff --git a/translators/CrossRef.js b/translators/CrossRef.js index 07118097b..2de5d9006 100644 --- a/translators/CrossRef.js +++ b/translators/CrossRef.js @@ -8,7 +8,7 @@ "maxVersion":"", "priority":90, "inRepository":true, - "lastUpdated":"2009-07-16 09:20:00" + "lastUpdated":"2009-09-18 01:05:00" } function detectSearch(item) { @@ -38,6 +38,10 @@ function processCrossRef(xmlOutput) { return false; } + // "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 ({}); + // ensure status is valid if(!xml.doi_record.length()) return false; // ensure this isn't an error @@ -140,7 +144,7 @@ function doSearch(item) { var co = Zotero.Utilities.createContextObject(item); } - Zotero.Utilities.HTTP.doGet("http://www.crossref.org/openurl?pid=zter:zter321&"+co+"&noredirect=true&format=unixref", function(responseText) { + Zotero.Utilities.HTTP.doGet("http://www.crossref.org/openurl/?pid=zter:zter321&"+co+"&noredirect=true&format=unixref", function(responseText) { processCrossRef(responseText); Zotero.done(); });