Fixes #1280 Added code to strip out the version number post-pended onto the ID when present.

This commit is contained in:
Matt Burton 2009-01-07 15:48:22 +00:00
parent adc3413d84
commit f589f6c3e3

View file

@ -62,6 +62,7 @@ function doWeb(doc, url) {
var newID = doc.evaluate('./text()', elmt, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().textContent;
newID = newID.replace(/arXiv:/, "");
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;
arXivIDs[i] = newID;
i++;
@ -72,6 +73,7 @@ function doWeb(doc, url) {
var newID= elmt.textContent;
newID = newID.replace(/arXiv:/, "");
newID = newID.replace(/\//g, "%2F");
newID = newID.replace(/v\d*/, ""); //remove version number
availableItems[i] = Zotero.Utilities.cleanString(title.textContent.replace(/^\s*Title:\s+/, ""));
arXivIDs[i] = newID;
i++;
@ -100,6 +102,8 @@ function doWeb(doc, url) {
arXivID = m[1];
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");
}