xml2
xml2 copied to clipboard
Huge String problem
I have an XML response from a Web Api query that returns a very large string text in one node. When I try to apply read_xml(response$content) I get a warning about a 'huge string nod', and the parsing fails.
This is a known issue with libxml, I guess. I have no easy way to send a reproducible example since the Api is proprietary. There seems to be some internal memory limit which is hardcoded, but can be relaxed.
Is there a setting in read_xml to enable the reading of huge strings?
# insert reprex here
I am having a similar issue where I am getting the following error from read_xml:
"Error in read_xml.raw(content, encoding = encoding, base_url = if (nzchar(base_url)) base_url else x$url, : internal error: Huge input lookup [1]"
I tried the following to (presumably) set the XML_PARSE_HUGE flag for xmlReadMemory, but still receive the same error.
xml2::read_xml(x, encoding = "utf-8", options = list("NOBLANKS", "HUGE"))
where x is an httr response that is 12.2MB.
Unfortunately I don't think there's much we can do here, sorry.