From 266e5ad25b7a5f8750229d6583ee53a2746586ea Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Wed, 29 Dec 2021 14:44:10 -0500 Subject: [PATCH] Crossref Unixref XML: Fix reference book with 'other' component type https://forums.zotero.org/discussion/93679/incorrect-entry-for-encyclopedia-entry-book-chapter-from-doi Allow a `componentType` of `other` when the `bookType` is `reference`. If the `bookType` is `other`, accept only `chapter` or `reference_type` as before. Not sure whether an `other`/`other` edited book would be possible, but this seems safer. --- Crossref Unixref XML.js | 50 +++++++++++++++++++++++++++++++++++------ 1 file changed, 43 insertions(+), 7 deletions(-) diff --git a/Crossref Unixref XML.js b/Crossref Unixref XML.js index 158855f48e5..4f857c1497a 100644 --- a/Crossref Unixref XML.js +++ b/Crossref Unixref XML.js @@ -1,18 +1,17 @@ { "translatorID": "93514073-b541-4e02-9180-c36d2f3bb401", - "translatorType": 1, "label": "Crossref Unixref XML", "creator": "Sebastian Karcher", "target": "xml", "minVersion": "3.0", - "maxVersion": null, + "maxVersion": "", "priority": 100, - "inRepository": true, - "browserSupport": "gcsibv", "configOptions": { "dataMode": "xml/dom" }, - "lastUpdated": "2021-07-15 09:33:14" + "inRepository": true, + "translatorType": 1, + "lastUpdated": "2021-12-29 19:43:47" } /* @@ -238,8 +237,10 @@ function doImport() { var bookType = itemXML[0].hasAttribute("book_type") ? itemXML[0].getAttribute("book_type") : null; var componentType = ZU.xpathText(itemXML[0], 'content_item/@component_type'); // is this an entry in a reference book? - var isReference = ["reference", "other"].includes(bookType) - && ["chapter", "reference_entry"].includes(componentType); + var isReference = (bookType == "reference" + && ["chapter", "reference_entry", "other"].includes(componentType)) + || (bookType == "other" + && ["chapter", "reference_entry"].includes(componentType)); // for items that are entry in reference books OR edited book types that have some type of a chapter entry. if ((bookType === "edited_book" && componentType) || isReference) { @@ -714,6 +715,41 @@ var testCases = [ "seeAlso": [] } ] + }, + { + "type": "import", + "input": "\n\n \n \n \n \n \n \n Jan\n Bulck\n \n \n \n The International Encyclopedia of Media Psychology\n \n 1\n \n 09\n 08\n 2020\n \n 9781119011071\n \n Wiley\n \n \n 10.1002/9781119011071\n \n \n http://doi.wiley.com/10.1002/tdm_license_1.1\n \n \n 10.1002/9781119011071\n 2020100613475700320\n https://onlinelibrary.wiley.com/doi/book/10.1002/9781119011071\n \n \n \n \n \n Allison\n Eden\n \n \n \n Appreciation and Eudaimonic Reactions to Media\n \n \n 09\n 09\n 2020\n \n \n 1\n 9\n \n \n 10.1002/9781119011071.iemp0172\n \n \n \n \n \n http://doi.wiley.com/10.1002/tdm_license_1.1\n \n \n 10.1002/9781119011071.iemp0172\n 2020100613475700320\n https://onlinelibrary.wiley.com/doi/10.1002/9781119011071.iemp0172\n \n \n https://onlinelibrary.wiley.com/doi/pdf/10.1002/9781119011071.iemp0172\n \n \n \n \n https://onlinelibrary.wiley.com/doi/pdf/10.1002/9781119011071.iemp0172\n \n \n https://onlinelibrary.wiley.com/doi/full-xml/10.1002/9781119011071.iemp0172\n \n \n \n \n \n 10.1080/15213269.2016.1182030\n \n \n 10.1080/23736992.2017.1329019\n \n \n 10.1111/jcom.12228\n \n \n 10.1080/10510974.2017.1340903\n \n \n 10.1111/jcom.12101\n \n \n 10.1080/15205436.2013.872277\n \n \n 10.1111/j.1468-2958.2009.01368.x\n \n \n 10.1027/1864-1105/a000029\n \n \n 10.1037/ppm0000066\n \n \n 10.1111/j.1460-2466.2011.01585.x\n \n \n The role of intuition accessibility on the appraisal and selection of media content\n Prabhu S.\n 2014\n \n \n 10.1080/15213269.2013.773494\n \n \n 10.1111/j.1460-2466.2012.01649.x\n \n \n 10.1111/jcom.12099\n \n \n 10.1111/jcom.12097\n \n \n 10.1111/jcom.12100\n \n \n 10.1027/1864-1105/a000031\n \n \n Sage handbook of media processes and effects\n Vorderer P.\n 455\n 2009\n \n \n 10.1111/j.1468-2958.2012.01434.x\n \n \n 10.1177/000276488031003005\n \n \n 10.1080/15213260701813447\n \n \n Thinking, fast and slow\n Kahneman D.\n 2011\n \n \n 10.1093/joc/jqx020\n \n \n \n \n \n \n", + "items": [ + { + "itemType": "bookSection", + "title": "Appreciation and Eudaimonic Reactions to Media", + "creators": [ + { + "creatorType": "editor", + "firstName": "Jan", + "lastName": "Bulck" + }, + { + "creatorType": "author", + "firstName": "Allison", + "lastName": "Eden" + } + ], + "date": "2020-09-09", + "ISBN": "9781119011071", + "bookTitle": "The International Encyclopedia of Media Psychology", + "edition": "1", + "extra": "DOI: 10.1002/9781119011071.iemp0172", + "language": "en", + "pages": "1-9", + "publisher": "Wiley", + "url": "https://onlinelibrary.wiley.com/doi/10.1002/9781119011071.iemp0172", + "attachments": [], + "tags": [], + "notes": [], + "seeAlso": [] + } + ] } ] /** END TEST CASES **/