1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-10-26 12:25:09 +03:00

xmllint: Support --html --sax

This commit is contained in:
Nick Wellnhofer 2024-09-27 22:54:14 +02:00
parent 225ed70737
commit 3ac214f01e

View File

@ -1363,6 +1363,24 @@ testSAX(const char *filename) {
} }
xmlSchemaFreeValidCtxt(vctxt); xmlSchemaFreeValidCtxt(vctxt);
} else } 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 #endif
{ {
xmlParserCtxtPtr ctxt = NULL; xmlParserCtxtPtr ctxt = NULL;