diff --git a/xmllint.c b/xmllint.c index 84de28af..f4052b40 100644 --- a/xmllint.c +++ b/xmllint.c @@ -1363,6 +1363,24 @@ testSAX(const char *filename) { } xmlSchemaFreeValidCtxt(vctxt); } else +#endif +#ifdef LIBXML_HTML_ENABLED + if (html) { + htmlParserCtxtPtr ctxt = NULL; + + ctxt = htmlNewSAXParserCtxt(handler, (void *) user_data); + if (ctxt == NULL) { + progresult = XMLLINT_ERR_MEM; + return; + } + + if (strcmp(filename, "-") == 0) + htmlCtxtReadFd(ctxt, STDIN_FILENO, "-", NULL, options); + else + htmlCtxtReadFile(ctxt, filename, NULL, options); + + htmlFreeParserCtxt(ctxt); + } else #endif { xmlParserCtxtPtr ctxt = NULL;