Re: [xml] Adding default DOCTYPE when HTML document doesn't have any

On Mon, Jul 26, 2010 at 01:57:16PM +0200, Daniel Veillard wrote:

this is added automatically at the end of htmlParseDocument() if no
doctype was found, and until now there is no option to turn this off.

Since this is an arbitrary behaviour from libxml2, and while this can
be fixed (by finding and removing said DTD from the resulting tree),
I think it's best to provide a new HTML_PARSE_NODEFDTD parsing option
for the HTML parser to avoid this. The code is actually fairly simple,
I'm attaching the patch I will commit soon,

Such option will be really useful for me, thanks!

Damian Pietras

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]