Re: validation of <noscript> inside links

On Wed, 14 Jul 2004, Simon Anderson wrote:

> The XHTML validator flags an error if a <noscript> element is included
> inside an <a> element.

(I'm getting curious: Why would anyone want to use <noscript> inside an
<a> element?)

The validator correctly reports an error. In XHTML, as well as in classic
HTML, the <a> element is an inline element, whereas <noscript> is a block
element. There's even a DTD comment to that effect:

<!-- these can only occur at block level -->
<!ENTITY % misc "noscript | %misc.inline;">

This is just a characterization. The formal reasoning needs to be based on
the exact definition of the content model of <a> and finding out, after
expanding the entities used in the definitions, that the content model
does not permit <noscript>.

> As I read the XHTML DTD, it states that
> <noscript> is allowed here.

Where would it say so?

-- 
Jukka "Yucca" Korpela, http://www.cs.tut.fi/~jkorpela/

Received on Wednesday, 14 July 2004 17:19:45 UTC