Handle RDF/XML SAX errors so they don't emit console messages #276

Closed
ansell opened this Issue Aug 7, 2016 · 2 comments

Comments

Projects
None yet
2 participants
@ansell
Contributor

ansell commented Aug 7, 2016

The RDF/XML parser regularly emits the following message to the console when it is used to parse a non-XML document:

[Fatal Error] :1:1: Content is not allowed in prolog.

The emission of that message to the console may be able to be avoided if we attach an ErrorHandler to the SAX parser.

@ansell

This comment has been minimized.

Show comment
Hide comment
@ansell

ansell Aug 7, 2016

Contributor

This issue relates to the following issue on OWLAPI where they are reusing the RDF/XML parser in a parser stack, and wish not to have errors emitted to the console if success occurs with a different parser:

owlcs/owlapi#550

Contributor

ansell commented Aug 7, 2016

This issue relates to the following issue on OWLAPI where they are reusing the RDF/XML parser in a parser stack, and wish not to have errors emitted to the console if success occurs with a different parser:

owlcs/owlapi#550

ansell added a commit to ansell/rdf4j that referenced this issue Aug 8, 2016

issue #276 : Add regression test to verify xmlReader.setErrorHandler
Signed-off-by: Peter Ansell <p_ansell@yahoo.com>

ansell added a commit to ansell/rdf4j that referenced this issue Aug 8, 2016

issue #276 : Reenable fix for fatal errors being printed to System.err
Signed-off-by: Peter Ansell <p_ansell@yahoo.com>
@ansell

This comment has been minimized.

Show comment
Hide comment
@ansell

ansell Aug 8, 2016

Contributor

I can't replicate this. Fix by me was done in 2.7.0, so it may be another SAX parser inside of OWLAPI generating the message:

https://openrdf.atlassian.net/browse/SES-666

https://bitbucket.org/openrdf/sesame/commits/c1a0bdbc2cc7ae645581b054444bb3f5ab61a55b

Will open a pull request in a second with an actual regression test that I have verified fails without the xmlReader.setErrorHandler call

Contributor

ansell commented Aug 8, 2016

I can't replicate this. Fix by me was done in 2.7.0, so it may be another SAX parser inside of OWLAPI generating the message:

https://openrdf.atlassian.net/browse/SES-666

https://bitbucket.org/openrdf/sesame/commits/c1a0bdbc2cc7ae645581b054444bb3f5ab61a55b

Will open a pull request in a second with an actual regression test that I have verified fails without the xmlReader.setErrorHandler call

@ansell ansell referenced this issue Aug 8, 2016

Merged

Issues/#276 rdfxml sax errorhandler #277

3 of 3 tasks complete

jeenbroekstra added a commit that referenced this issue Aug 8, 2016

@jeenbroekstra jeenbroekstra added this to the 2.0 milestone Aug 8, 2016

@jeenbroekstra jeenbroekstra added the bug label Aug 8, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment