I originally posted:
>> It was XHTML (see XHTML spec, which came out between HTML 4 and 5) that
>> said that all tags, including "empty" tags, must be closed.
"Jukka K. Korpela" <
jkor...@cs.tut.fi> writes:
> It's about closing elements, not tags. Here the distinction is
> essential.
... and especially on a newsgroup devoted to HTML, you're right, I
used the wrong terminology and should have been more careful.
> And it was not XHTML that defined this feature; it was XML, and
> XHTML could not help adopting it, because it is by design an "XML
> application".
Yes, but I doubt the OP cared about so detailed a history.
"See XHTML" seemed sufficient.
>> From what I've seen, XHTML *required* a space before the closing '/'
>> in such tags,
> No it does not (or "did not"). ... It simply says that for
> compatibility with old browsers, a space *should* be used there on web
> pages and other contexts where compatibility is relevant.
My mistake, then. I thought that SHOULD had enough emphasis that that's
how everyone was supposed to be doing it.
[and later...]
> Wrong. In HTML mode, <tag/> is just <tag>,
(You must not be talking about really old user agents here.)
> and in XHTML mode, <tag/> and
> <tag /> are treated the same. It's some old user agents that did not get
> <tag/> right as an *opening* tag that lead to the space recommendation.
where "not right" is actually "would fail to recognize tag at all
because it was parsed as < + tag/ + >, and tag/ was not a recognized
mark type (e.g., Mosaic-2.4/libhtmlw/HTMLparse.c:ParseMarkType only
ended the name at NUL or isspace()).
>> Once lots of pages using the invalid construct existed, the web
>> browser developers that adhered to the XHTML spec found themselves at a
>> competitive disadvantage and so switched to accepting constructs such as
>> "<div/>" as valid.
> You are just making things up.
I'll rephrase. When I was modifying Chimera's parser to accommodate the
then-new "/>", the XHTML stuff I saw said don't do <tag/>. I indeed
read it as virtually MUST, not SHOULD. I rapidly discovered there were
lots of web pages, and apparently some web page authoring tools, that
left out that space, and concluded that it was very unlikely they would
ever be fixed to do as XHTML said they should. I then changed my code
to accept <tag/> as < + tag + />, whether I thought leaving out the
space was valid or not. None of this matters in the least to anyone
else, though.
Rewriting the earlier comment in light of my misunderstanding...
Although people were told to use "<tag />", that recommendation has
generally been widely ignored, and lots of pages use the <tag/> form.
In any case, if the OP reads any of this, I think the question of what
<div/> means and where it came from has been answered.
-WBE