W3C home > Mailing lists > Public > www-validator@w3.org > February 2005

Re: noscript validation issue

From: David Dorward <david@dorward.me.uk>
Date: Fri, 4 Feb 2005 08:19:41 +0000
To: paul@webotech.co.uk
Cc: www-validator@w3.org
Message-ID: <20050204081941.GE13619@us-lot.org>

On Thu, Feb 03, 2005 at 07:01:15PM +0000, paul@webotech.co.uk wrote:
> 
> If I validate this code: 

> <p>Your currency is set to
> <script language="javascript" type="text/javascript">
> <!--
> document.write('<b>USD<\/b>');
> //-->
> </script>
> <noscript><b>USD</b></noscript>
> ..</p>


> I get this error:
> #Line 17, column 4: end tag for element "P" which is not open 
> 
> However, the code is HTML4.01 compliant if I remove 
> <noscript><b>USD</b></noscript> 
> 
> As far as I am aware I am allowed to embed <noscript> tags within <p> tags,

You aren't. http://w3.org/TR/html4/sgml/dtd.html

<!ENTITY % block
     "P | %heading; | %list; | %preformatted; | DL | DIV | NOSCRIPT |
      BLOCKQUOTE | FORM | HR | TABLE | FIELDSET | ADDRESS">

i.e. "NOSCRIPT is part of that group of elements that are 'block'"

<!ELEMENT P - O (%inline;)*            -- paragraph -->

i.e. "P elements may contain only elements in the group 'inline'"

If you go through the document you will find that there is nothing
that places the elements in the inline group in the block group.

Therefore, since the end tag for <p> is optional, and <noscript> is
not allowed there, starting a <noscript> inside a paragraph implies
closing the paragraph at that point. Thus there is no longer a
paragraph open when the parser reaches the </p>.

-- 
David Dorward                                      http://dorward.me.uk
Received on Friday, 4 February 2005 09:12:18 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:14:18 GMT