|
Posted by Zone on 01/23/08 15:25
"Jukka K. Korpela" <jkorpela@cs.tut.fi> wrote in message
news:1jFlj.285172$8v3.64083@reader1.news.saunalahti.fi...
> Scripsit Toby A Inkster:
>
>> <input> (and <textarea>, <button>) is an inline element, like <span>
>> or <em>, so can be used in any context where inline content is
>> allowed, which is virtually everywhere.
>
> Well, not quite everywhere. Not in the document's head, and in Strict, not
> in its body either. :-)
>
> (Just kidding. But really, in Strict versions, <input> is not allowed
> _directly_ inside <body>, i.e. as a child element, only indirectly inside
> a block-like container.)
>
>> Why? Because otherwise <input> couldn't be contained in, for example,
>> a paragraph, even if that paragraph was itself within a form,
>
> No, the syntax rules _could_ have been written so that <input> is only
> allowed inside a <form> directly or indirectly. That would be fairly
> simple in classic HTML, nominally based on SGML (which has exclusion
> exceptions). It would not be possible at the DTD level in XHTML, based on
> the toy version of SGML called XML, but it could have been added as
> requirement in prose, just as XHTML 1.0 prosaically forbids an <a> element
> inside an <a> element even though its DTD syntax allows it.
>
> The real reason is that people who decided on HTML specs wanted to allow
> lone <input> elements for use with client-side scripting.
>
> --
> Jukka K. Korpela ("Yucca")
> http://www.cs.tut.fi/~jkorpela/
Can anyone explain where are the code in
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
that tells input tag can be outside of form tag but it must be e.g. inside
div tag.
This kind of issues can be tested by a validator but I would like know how
to read it from DTD file's syntax.
Cheers,
Navigation:
[Reply to this message]
|