Skip to content

Commit

Permalink
Suppress XML parsing errors (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
simon987 committed Feb 2, 2020
1 parent c9870a6 commit 8300838
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Binary file modified lib/libopc/libopc.a
Binary file not shown.
9 changes: 8 additions & 1 deletion src/parsing/doc.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,14 @@ __always_inline
void read_part(opcContainer *c, dyn_buffer_t *buf, opcPart part, document_t *doc) {

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) {
LOG_ERRORF(doc->filepath, "(doc.c) opcXmlReaderOpen() returned error code %d", ret);
Expand Down

0 comments on commit 8300838

Please sign in to comment.