Harlan Messinger <hmessinger.removethis@comcast.net> wrote:
[color=blue]
> I just read the note under the XHTML spec
> (
http://www.w3.org/TR/xhtml1/#h-4.9) that explains how XML DTD
> notation doesn't provided for the exclusion of elements from
> containment by the element being defined.[/color]
Quite right. This puts the widespread cargo cult slogan
"XHTML is more rigorous than tag-soup HTML" into perspective.
[color=blue]
> For example, there is no
> way to indicate that an <a> element can't contain another one.[/color]
Actually, the DTD could be rewritten to disallow <a> elements within
<a> elements. But it would mean lots of rules.
[color=blue]
> I see that the strict HTML DTD shows
>
> -(A)
>
> in the definition of the <a> element.[/color]
Ditto in other HTML DTDs.
[color=blue]
> But AFAIK this means that an
> anchor can't *directly* contain another one, and it doesn't cover a
> situation like (attributes omitted)
>
> <a>some <i>italicized <a>text</a> goes </i>here</a>[/color]
No, it forbids that too. A validator will report an error.
The meaning of -(A) in a DTD is defined, in the SGML standard, in a
manner that excludes any occurrence of A in the content, either
directly as a subelement, or as a subelement of subelement etc.
[color=blue]
> I looked for a note in the HTML spec that would correspond with
> the one in the XHTML notes indicating that the above code isn't
> acceptable, but didn't find one. Can anyone explain the
> particulars?[/color]
In principle there is no need to say in prose something that is said in
a formalized manner in a DTD. In practice, few people read DTDs, and
even fewer understand them.
[color=blue]
> By the way, in the XHTML notes, only a few specific prohibitions
> are noted (
http://www.w3.org/TR/xhtml1/#prohibitions), but these
> don't include nested <i>. What, in either XHTML or HTML, prevents
> an <i> nested inside another one?[/color]
Nothing.
[color=blue]
> Or am I wrong that such nesting
> is prohibited--but in that case, what is the meaning of nested <i>?[/color]
The same as unnested. Physical markup like <i> is idempotent. Not all
physical markup is; for example <big><big>...</big></big> could be
argued as indicating bigger than big (the specification is vague), and
that's how browsers treat it. A case could be made for
<b><b>...</b></b> too, since bolding could be viewed as relative, but
it seems that browsers don't behave that way - they treat <b> as
correspong to CSS declaration font-weight: bold even in situations
where more than one degree of bolding exists (which depends on the font
and on the browser etc.).
The semantics of nested markup is generally vaguely defined, or left
completely undefined, in HTML specs. The general idea is probably that
nested emphasis _should_ be honored, but browsers really don't bother.
Consider <em>...<em>...</em>...</em>. A good implementation, if it uses
italics, would switch to upright style for the inner <em> element or
otherwise indicate it as different from the surrounding text. But to
browsers, <em> is just a synonym for <i>, though kept as a separate
symbol so that you can _style_ it differently. Ooops, I seem to have
revealed a secret that we Purists have tried to protect from the masses
who would misunderstand it... :-)
--
Yucca,
http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring:
http://www.cs.tut.fi/~jkorpela/www.html