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

W3 Validator XHTML parse error with CGI.pm generated $query->start_html(-script)

From: Brock Murch <bmurch@seas.marine.usf.edu>
Date: Fri, 13 Jun 2003 13:44:57 -0400
To: "Lincoln D. Stein" <lstein@cshl.org>, www-validator@w3.org
Message-Id: <200306131344.57023.bmurch@marine.usf.edu>

Mr. Stein & Validator List:

Background:
perl -MCGI -e 'print $CGI::VERSION' > 2.95
perl -v >This is perl, v5.8.0 built for i386-linux-thread-multi
server:Apache/2.0.40 (Red Hat Linux) mod_perl/1.99_05-dev Perl/v5.8.0 
mod_auth_pgsql/0.9.12 PHP/4.2.2 mod_python/3.0.0 Python/2.2.1 mod_ssl/2.0.40 
OpenSSL/0.9.6b DAV/2
cat /etc/redhat-release
Red Hat Linux release 8.0 (Psyche)

When trying to validate xhtml I am having an error:

This is the code snippet:

print $query->header(-target=>'_blank');
print $query->start_html(	-title=>"$title",
				-script=>"$javascript",
				-onLoad=>"launch()",
				-head=>[ Link({-rel=>'stylesheet',
					 -type=>'text/css',
			                 -href=>'/css/SSTProject.css'}),
			           Link({-rel=>'stylesheet',
					 -type=>'text/css',
				         -href=>'/css/common.css'})]
				);

Basically the XML validator chokes on comments inside the <script> tag with 
xhtml. If there is a open <!-- to hide the script... (placed there via the 
CGI.pm module) and later a decrement is used (ie var this-- ) the parser 
calls it a  "invalid comment declaration" I have saved a copy of the script 
output as a static page here:

http://www.imars.usf.edu/SST/animate_CGI.html
http://validator.w3.org/check?uri=http%3A%2F%2Fwww.imars.usf.edu%2FSST%2Fanimate_CGI.html

To make the page pass the parse test I only need to do remove the <!--comments 
tags-->:

eg:
diff animate.html animate_CGI.html
9c9
<
---
> <!-- Hide script
298c298
< //]]>
---
> //]]> End script hiding -->

The page is then validated

http://www.imars.usf.edu/SST/animate.html
http://validator.w3.org/check?uri=http%3A%2F%2Fwww.imars.usf.edu%2FSST%2Fanimate.html

Any ideas on this? I am not a member of the list so please mail me directly.

-- 
Brock Murch
Institute for Marine Remote Sensing 
University of South Florida 
140 7th Ave South  
St. Petersburg, FL 33701 
http://imars.usf.edu/
(727) 553-1186
Received on Friday, 13 June 2003 13:54:31 GMT

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