Closed
Description
I'm working on a script to extract data from 33k xml files, so I'd like to suppress all warnings and messages. But the warning-like xmlXPathEval: evaluation failed
that shows up on certain kinds of errors (an undefined namespace, in the MWE) doesn't seem to be either a message or a warning. What is this, and how can I suppress it?
MWE:
library(xml2)
file = '2-s2.0-0015762931.xml'
xml = read_xml(file)
out = xml_find_first(xml, '//dc:identifier')
suppressWarnings(out <- xml_find_first(xml, '//dc:identifier'))
suppressMessages(out <- xml_find_first(xml, '//dc:identifier'))
if (require(purrr)) {
out = quietly(xml_find_first)(xml, '//dc:identifier')
}
Metadata
Metadata
Assignees
Labels
No labels