Re: Request for clarification -- HyperText Markup Language Specification - 2.0

Earl Hood (ehood@imagine.convex.com)
Tue, 1 Nov 94 14:16:01 EST

> In the `DTD Element References' in Section 7, there seem to be some
> peculiarities with respect to <IMG ...>. For instance, it appears that
> an image may not be included in preformatted text
>
> <PRE><IMG SRC="funnychar.gif">This line contains a funny glyph</PRE>
> * Forbidden
>
> However, <EM> is allowed within <PRE>, and <IMG> is allowed within <EM>:
>
> <PRE><EM><IMG SRC="funnychar.gif"></EM>This line contains a funny glyph</PRE>
> * Allowed (?)

According to the DTD the second is legal, but the first is not. I
believe the first should be legal. It is probably an oversight and
should be corrected.

> The element references seem to be full of similar anomalies. Another example
> is that <INPUT> appears to be allowed only as direct content of a <FORM>.
> Surely, this cannot be what was intended; most forms that I've examined
> are structured like:
>
> <FORM METHOD=GET ACTION="HTTP://MY.HOST.NAME/REST/OF/URL">
> <P>Your name:<INPUT TYPE=TEXT SIZE=16 NAME=NAME></P>
> <P>Your e-mail address:<INPUT TYPE=TEXT SIZE=32 NAME=EMAIL></P>
> <P><INPUT TYPE=SUBMIT VALUE="Submit"><INPUT TYPE=RESET VALUE="Reset"></P>
> </FORM>
>
> and have <INPUT>'s interspersed freely with characters. Otherwise, there's
> no attractive way to label the input fields, and so on. Do I really have
> to have the inputs stand alone outside of paragraphs? That looks awful!

The INPUT element is part of the inclusions exception for the FORM
element. This means that an INPUT element can occur *anywhere* inside
the content of a FORM (including embedded elements). Your example is
legal according to the current DTD.

--ewh