Re: [xml] patch: support <embed> in HTML parser

On Thu, Apr 26, 2007 at 10:15:06PM +1000, Michael Day wrote:
Hi Daniel,

Is endTag=1 correct? (means the end tag can be omitted).

other elements would close it then. I must admit I don't fully remember
the algorithm ...

Actually it looks a little bit more complicated still, as the embed 
element *is* empty, but still has a close tag:


Presumably this is for compatibility with browsers that don't recognise 
it specially like img, and would get confused if it didn't close.

In theory this should require setting empty=1 and endTag=1, to indicate 
that the element is empty but that end tag can be omitted. However, the 
HTML parser does not really support this: if empty=1 it will complain 
when it sees an end tag, even if there is no content in the element.

The next best alternative is to set empty=0 and endTag to 0, 1 or 3; it 
doesn't seem to matter which.

Doing a quick grep in HTMLparser.c, it seems that endTag is only ever 
compared with 3, and startTag is never checked at all (!) so maybe none 
of this is very critical, anyway :)

  haha :-)


Red Hat Virtualization group
Daniel Veillard      | virtualization library
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

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