W3C home > Mailing lists > Public > html-tidy@w3.org > April to June 2003

RE: Problem with INPUT tags

From: Richard A. O'Keefe <ok@cs.otago.ac.nz>
Date: Thu, 10 Apr 2003 13:49:45 +1200 (NZST)
Message-Id: <200304100149.h3A1njoU153646@atlas.otago.ac.nz>
To: CeBlanc@lyon-partdieu.sema.slb.com, html-tidy@w3.org

"BLANC Cedric - LYO ( CeBlanc@lyon-partdieu.sema.slb.com )" wrote:
	I think I wasn't clear enough in my last message : in my input
	file, <INPUT> tags are not closed and I cannot close them by
	myself, because its HTML code is produced by an HTML editor (the
	one included in WSAD).

In the HTML 4.01 DTD we find
    <!ELEMENT INPUT - O EMPTY              -- form control -->

This means that the *ONLY* legal form of an <INPUT> element is
    <INPUT att=val....>

Not only do you not *need* a </INPUT> tag,
you aren't *allowed* to have one.  Quoting the SGML standard,
"empty elements do not have end-tags" (meaning elements *declared*
to be EMPTY, not elements that just happen to be empty).
More explicitly, 7.3 says
    If an element has a declared content of "EMPTY" [which INPUT does],
    or an explicit content reference [not used in HTML], the end-tag
    ****MUST**** be omitted [my emphasis].

In XML, empty elements may be written as
    <tag att=val...></tag>
with absolutely nothing between > and </ or as
    <tag att=val.../>
so in *X*HTML you have to write
    <input att=val.../>
with lower-case "input".

To repeat, in HTML input or output, there MUST NOT be any </INPUT>
end tags, while in XHTML input or output there may be </input> end
tags or <input .../> empty tags may be used.
Received on Wednesday, 9 April 2003 21:50:10 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 3 April 2012 06:13:54 GMT