Johannes wrote:
Hi,
while working on css I came across the following:
<a class="d" name="INCR32"/> (found at [1])
dillo currently doesn't recognize that the element is empty. The relevant code is at html.cc:3530:
/* Test for </x>, ReqTagClose, <x /> and <x/> */ if (*start == '/' || /* </x> */ html->ReqTagClose || /* request */ (tag[tagsize - 2] == '/' && /* XML: */ (isspace(tag[tagsize - 3]) || /* <x /> */ (size_t)tagsize == strlen(Tags[ni].name) + 3))) { /* <x/> */
We could simply drop the requirement for the blank before '/' which would lead to
/* Test for </x>, ReqTagClose, <x /> and <x/> */ if (*start == '/' || /* </x> */ html->ReqTagClose || /* request */ (tag[tagsize - 2] == '/')) { /* XML */
or allow a '"' instead of the blank or keep things as they are, if XML requires a blank before the '/'.
From http://www.w3.org/TR/2006/REC-xml-20060816/#sec-starttags I'd say the blank is optional.
What do you think?
Yes, it looks like whitespace is optional there. EmptyElemTag ::= '<' Name (S Attribute)* S? '/>' S ::= (#x20 | #x9 | #xD | #xA)+
[1] http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libc/port/...