W3C home > Mailing lists > Public > www-validator@w3.org > October 2006

XTHML 1.0 Strict validation of noscript

From: Rui del-Negro <rmn@dvd-hq.info>
Date: Sun, 15 Oct 2006 18:46:28 +0100
To: www-validator@w3.org
Message-ID: <op.thg4zqu9ztikme@bigbang>

I've noticed that if I try to validate this as XHTML 1.0 Strict:

--- 8< ---
<p>Hello

<script type="text/javascript">
  <!--
  print_user_name();
  // -->
</script>
<noscript>
dear user,
</noscript>

and welcome to our site.</p>
--- 8< ---

I get an error saying <noscript> isn't allowed there, and must be placed  
inside an <ins>, <del>, <object> or some other tag (don't remember exactly  
which right now).

Why? I mean, if scripting isn't active, the contents of the <noscript>  
block will essentially behave as if they were within the containing  
element (in this case a <p>), no? So why do I have to enclose it in an  
<ins> container (for example)?

Also, if, in addition to "dear user", I want to include an icon (i.e., an  
<img>), the validator tells me images aren't allowed inside a <noscript>  
(even though this one is already inside an <ins>, which in turn is inside  
a <p>), and I have to enclose them into yet another <ins>. In other words,  
I end up with something like this to pass validation:

--- 8< ---
<p>Hello

<script type="text/javascript">
  <!--
  print_user_name();
  // -->
</script>
<ins>
  <noscript>
   <ins>
    <img="..." alt="..." />dear user,
   </ins>
  </noscript>
</ins>

and welcome to our site.</p>
--- 8< ---

Which is kind of ridiculous.

Is this a bug in the validator, or just some strange "feature" of XHTML  
1.0 Strict?

The weird thing is that I'm pretty sure the first version of the code  
validated fine two weeks ago, and the validator only started complaining  
recently.

RMN
~~~
Received on Sunday, 15 October 2006 17:46:44 GMT

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