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

XHTML script validation error

From: Andras <lgandras@hotmail.com>
Date: Mon, 2 Jun 2008 22:05:43 -0430
Message-ID: <BAY132-DS552C0485841FF97F4C0C8CFBA0@phx.gbl>
To: <www-validator@w3.org>
Hello,

My suggestion is simple. Whenever a script is in the head on an XHTML 1.0 document, it should validate '<' (less than) characters:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Title</title>
<script type='javascript'>
var myvar = 0;
for (var i = 0; i < 10; i ++){
    myvar += i;
};
alert(myvar);
</script>
</head>

<body>
</body>
</html>

That's supposed to be valid, but the validator tells that the '<' occurred as data.

Thanks for reading,

Andras
Received on Wednesday, 4 June 2008 07:38:51 GMT

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