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:
parent
225ed70737
commit
3ac214f01e
18
xmllint.c
18
xmllint.c
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user