Permalink
Browse files

[PNX] Make Harvard parsing more robust (#1703)

  • Loading branch information...
adam3smith committed Aug 3, 2018
1 parent ea743e2 commit c58416bd57e874ff3f12465d762df08e4819dae2
Showing with 6 additions and 4 deletions.
  1. +6 −4 Primo Normalized XML.js
View
@@ -12,7 +12,7 @@
"configOptions": {
"dataMode": "xml/dom"
},
"lastUpdated": "2018-07-25 08:35:00"
"lastUpdated": "2018-07-28 14:15:00"
}
/*
@@ -293,16 +293,18 @@ function doImport() {
if (source) {
//The HVD library code is now preceded by $$V01 -- not seeing this in other catalogs like Princeton or UQAM
//so making it optional
library = source.match(/^(?:\$\$V\d+)?(.+?)_/);
library = source.match(/^(?:\$\$V)?(?:\d+)?(.+?)_/);
if (library) library = library[1];
}
//Z.debug(library)
// Z.debug(library)
if (library && library == "HVD") {
if (ZU.xpathText(doc, '//p:display/p:lds01', ns)) {
item.extra = "HOLLIS number: " + ZU.xpathText(doc, '//p:display/p:lds01', ns);
}
for (let lds03 of ZU.xpath(doc, '//p:display/p:lds03', ns)) {
item.attachments.push({url: lds03.textContent.match(/href=\"(.+?)\"/)[1], title: "HOLLIS Permalink", snapshot: false});
if (lds03.textContent.match(/href=\"(.+?)\"/)) {
item.attachments.push({url: lds03.textContent.match(/href=\"(.+?)\"/)[1], title: "HOLLIS Permalink", snapshot: false});
}
}
}
// End Harvard-specific code

0 comments on commit c58416b

Please sign in to comment.