W3C home > Mailing lists > Public > www-validator@w3.org > September 2005

HTML end tags for empty elements

From: Alun Jones <a.jones@hccnet.nl>
Date: Sat, 10 Sep 2005 10:42:09 +0200
Message-ID: <43229C61.8030506@hccnet.nl>
To: www-validator@w3.org
In HTML the element input and img are not flagged as errors when end 
tags are added:
<input type="text" />
should be
<input type="text">
No errors or warnings are given by the validator.

The W3C Recommendation for input 
<http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.4> does not 
allow a closing tag:

<!ELEMENT INPUT <http://www.w3.org/TR/REC-html40/interact/forms.html#edef-INPUT> - O EMPTY              -- form control -->

O EMPTY <http://www.w3.org/TR/REC-html40/intro/sgmltut.html#h-3.3> "The hyphen and the following "O" indicate that the end tag can be omitted,
but together with the content model "EMPTY", this is strengthened to the rule
that the end tag *must* be omitted."

Should not all of these EMPTY elements be flagged as errors when end 
tag/slash are added, for all HTML Doctypes?

Alun Jones
Received on Saturday, 10 September 2005 11:41:16 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:58:53 UTC