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

RE: Problem with INPUT tags

From: BLANC Cedric - LYO ( CeBlanc@lyon-partdieu.sema.slb.com ) <CeBlanc@lyon-partdieu.sema.slb.com>
Date: Thu, 10 Apr 2003 09:34:24 +0200
To: html-tidy@w3.org
Message-id: <1B9D8A2F7E92D611967D009027D0897E2C9FDA@lyomes01.lyon.eur.slb.com>

Well, I thought that in HTML closing tags were just optional for empty
elements, I didn't thought they must not appear.
Thanks for the information !


-----Message d'origine-----
De : Richard A. O'Keefe [mailto:ok@cs.otago.ac.nz]
Envoye : jeudi 10 avril 2003 03:50
A : BLANC Cedric - LYO ( CeBlanc@lyon-partdieu.sema.slb.com );
Objet : RE: Problem with INPUT tags

"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 Thursday, 10 April 2003 04:07:06 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:06:49 UTC