Permalink
Browse files
[PNX] Make Harvard parsing more robust (#1703)
- Loading branch information...
Showing
with
6 additions
and
4 deletions.
-
+6
−4
Primo Normalized XML.js
|
@@ -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