References for articles from "Gènese" are currently not being extracted. Example file: journal-article-10.2307_26197863.xml
This is the responsible function:
extract_ref_content <- function(x) {
if (identical(xml2::xml_attr(x, "content-type"), "parsed-citations")) {
x %>%
xml_find_all("title|ref/mixed-citation") %>%
map_chr(collapse_text)
} else if (is.na(xml2::xml_attr(x, "content-type"))) {
x %>%
xml_find_all("title|ref/mixed-citation/node()[not(self::*)]") %>%
xml_text() %>%
purrr::keep(str_detect, "[a-z]") %>%
str_replace("^\\\n", "") # remove "\n" at beginning of strings
} else if (identical(xml2::xml_attr(x, "content-type"), "unparsed")) {
x %>%
xml_find_all("title|ref/mixed-citation") %>%
xml_text()
}
}
The content-type of the references is "unparsed-citations" and it therefore fails silently.
Solutions:
Change the last else if to include "unparsed-citations"
make the last case more general to simply apply to all other cases
add another case. This case could either be the same as the third, or it could emit a message along the lines "Type of reference not recognized. Please alert package maintainer at 'url to GitHub'"
References for articles from "Gènese" are currently not being extracted. Example file: journal-article-10.2307_26197863.xml
This is the responsible function:
The content-type of the references is "unparsed-citations" and it therefore fails silently. Solutions: