Suppress XML parsing errors (#18)

This commit is contained in:
simon 2020-02-02 09:26:03 -05:00
parent c9870a6d3d
commit 8300838d30
2 changed files with 8 additions and 1 deletions

Binary file not shown.

View File

@ -55,7 +55,14 @@ __always_inline
void read_part(opcContainer *c, dyn_buffer_t *buf, opcPart part, document_t *doc) { void read_part(opcContainer *c, dyn_buffer_t *buf, opcPart part, document_t *doc) {
mceTextReader_t reader; mceTextReader_t reader;
int ret = opcXmlReaderOpen(c, &reader, part, NULL, "UTF-8", 0); int options;
if (LogCtx.very_verbose) {
options = XML_PARSE_NONET;
} else {
options = XML_PARSE_NOWARNING | XML_PARSE_NOERROR | XML_PARSE_NONET;
}
int ret = opcXmlReaderOpen(c, &reader, part, NULL, "UTF-8", options);
if (ret != OPC_ERROR_NONE) { if (ret != OPC_ERROR_NONE) {
LOG_ERRORF(doc->filepath, "(doc.c) opcXmlReaderOpen() returned error code %d", ret); LOG_ERRORF(doc->filepath, "(doc.c) opcXmlReaderOpen() returned error code %d", ret);