Fixes #1280 Added code to strip out the version number post-pended onto the ID when present.
This commit is contained in:
parent
adc3413d84
commit
f589f6c3e3
1 changed files with 6 additions and 2 deletions
|
@ -62,6 +62,7 @@ function doWeb(doc, url) {
|
||||||
var newID = doc.evaluate('./text()', elmt, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().textContent;
|
var newID = doc.evaluate('./text()', elmt, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().textContent;
|
||||||
newID = newID.replace(/arXiv:/, "");
|
newID = newID.replace(/arXiv:/, "");
|
||||||
newID = newID.replace(/\//g, "%2F");
|
newID = newID.replace(/\//g, "%2F");
|
||||||
|
newID = newID.replace(/v\d*/, ""); //remove version number
|
||||||
availableItems[i] = doc.evaluate(titleNode, title, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().textContent;
|
availableItems[i] = doc.evaluate(titleNode, title, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().textContent;
|
||||||
arXivIDs[i] = newID;
|
arXivIDs[i] = newID;
|
||||||
i++;
|
i++;
|
||||||
|
@ -72,6 +73,7 @@ function doWeb(doc, url) {
|
||||||
var newID= elmt.textContent;
|
var newID= elmt.textContent;
|
||||||
newID = newID.replace(/arXiv:/, "");
|
newID = newID.replace(/arXiv:/, "");
|
||||||
newID = newID.replace(/\//g, "%2F");
|
newID = newID.replace(/\//g, "%2F");
|
||||||
|
newID = newID.replace(/v\d*/, ""); //remove version number
|
||||||
availableItems[i] = Zotero.Utilities.cleanString(title.textContent.replace(/^\s*Title:\s+/, ""));
|
availableItems[i] = Zotero.Utilities.cleanString(title.textContent.replace(/^\s*Title:\s+/, ""));
|
||||||
arXivIDs[i] = newID;
|
arXivIDs[i] = newID;
|
||||||
i++;
|
i++;
|
||||||
|
@ -100,6 +102,8 @@ function doWeb(doc, url) {
|
||||||
arXivID = m[1];
|
arXivID = m[1];
|
||||||
arXivID = arXivID.replace(/\//g, "%2F");
|
arXivID = arXivID.replace(/\//g, "%2F");
|
||||||
}
|
}
|
||||||
|
arXivID = arXivID.replace(/v\d*/, ""); //remove version number
|
||||||
|
Zotero.debug("ID= "+ arXivID);
|
||||||
newURIs.push("http://export.arxiv.org/oai2?verb=GetRecord&identifier=oai%3AarXiv.org%3A" + arXivID + "&metadataPrefix=oai_dc");
|
newURIs.push("http://export.arxiv.org/oai2?verb=GetRecord&identifier=oai%3AarXiv.org%3A" + arXivID + "&metadataPrefix=oai_dc");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue