SWI-Prolog / packages-sgml

The SWI-Prolog SGML/XML/HTML parser
5 stars 9 forks source link

Syntax error messages cannot be silenced for load_html/3 #4

Closed wouterbeek closed 7 years ago

wouterbeek commented 9 years ago

Syntax error messages cannot be silenced for load_html/3.

Reproducible example:

?- [library(sgml)].
?- [library(http/http_open)].
?- IRI = 'https://lists.w3.org/Archives/Public/w3c-rdfcore-wg'.
?- load_html($IRI, _, [syntax_errors(quiet)]).
SGML: Redefined entity "lt"
SGML: Redefined entity "gt"
SGML: Redefined entity "amp"
SGML: Redefined entity "apos"
SGML: Redefined entity "quot"
JanWielemaker commented 9 years ago

It comes from loading the HTML DTD in an XML context, not from the document itself. Not sure what to think about this. xhtml is dead anyway ...

triska commented 8 years ago

I ran into the exact same issue on other sites and would greatly appreciate if this warning were also silenced. For example, I need HTML parsing in cronjobs, and currently I must use:

swipl parse_html.pl &> /dev/null

to suppress such output.

The severe drawback: This also suppresses other output that is far more important, such as if the swipl executable is not found.

JanWielemaker commented 7 years ago

Fixed with 46e48182ab03ac4ac8fd8bbfcd70c276bc780858