r-lib / xml2

Bindings to libxml2
https://xml2.r-lib.org/
Other
220 stars 82 forks source link

read_xml "NOWARNING" option does not suppress namespace warnings #385

Open cole-johanson opened 1 year ago

cole-johanson commented 1 year ago

The "NOWARNING" options states it should suppress warning reports from the libxml2 parser. It does not suppress warnings about the namespace prefix on nodes.

The use-case here is the WordProcessingML from Microsoft's Open XML SDK.

xml2::read_xml("<w:t></w:t>", options = "NOWARNING")
#> Warning in read_xml.raw(charToRaw(enc2utf8(x)), "UTF-8", ..., as_html =
#> as_html, : Namespace prefix w on t is not defined [201]
#> {xml_document}
#> <w:t>