RE: Problem with INPUT tags

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 !

Cedric

-----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 );
html-tidy@w3.org
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