W3C home > Mailing lists > Public > www-validator@w3.org > June 2000

Re: more validator helpfulness

From: Nir Dagan <nir@nirdagan.com>
Date: Fri, 2 Jun 2000 00:16:08 -0400 (EDT)
Message-Id: <4.2.2.20000602000004.00a34320@nirdagan.com>
To: www-validator@w3.org
Concerning:

"1)  <script language=text/javascript>

     This is invalid because the attribute value must be enclosed
     with quotes.  However, the validator only reported an error
     at the </script> element, far below, complaining that there
     was no opening script element."

This seemingly wrong error message may very well be 
correct, although confusing.

The complete document:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<html>
   <head>
<script language=text/javascript> foo bar / </script>
     <title></title>

   </head>
   <body>
some text here
   </body>
</html>

gives me in http://www.htmlhelp.com/tools/validator/direct.html
The error:
"Error: end tag for element SCRIPT which is not open; try removing the end tag or check for improper nesting of elements"

This is because according to SGML the content of the script element is considered to be 
in between the two slashes (the first in text/javascript) and the second before the </script>
I.e., it is equivalent to: 

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<html>
   <head>
<script language=text>javascript> foo bar  </script> </script>
     <title></title>

   </head>
   <body>
some text here
   </body>
</html>

This construct is discussed in: 
  http://www.w3.org/TR/html4/appendix/notes.html#h-B.3.3

Strange, but true.
Nir.

===================================
Nir Dagan, Ph.D.

http://www.nirdagan.com
mailto:nir@nirdagan.com
Received on Tuesday, 20 June 2000 13:11:05 GMT

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