We've just recently started having problems with some people using Internet Explorer 6 to access our web-site. Basically they would receive an error message like:
 
The XML page cannot be displayed
Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.

--------------------------------------------------------------------------------

A string literal was expected, but no opening quote character was found. Error processing resource 'http://www.fastmail.fm/mail/login/'. Line 4, Position 2

SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
After playing around for a while, I discovered that each web-page we were generating was XHTML, even though I had:
 
    use CGI qw(-no_xhtml);
 
in our code. More searching showed that the first page generated by a process was correctly "HTML 4.01 Transitional", but every page after that was XHTML.
 
Anyway, it turns out when you do something like:
 
    my $q = new CGI({});
 
In your code, it registers an Apache cleanup handler which clobbers all the global setup variables (eg $XHTML, $DEBUG, etc) after the first run. I've passed this on to Lincoln Stein who currently agrees with me that this is a bug. For the moment, I've added this to my code as a hack which works:
 
    $CGI::XHTML = 0;
    my $q = new CGI({});
 
Hope this helps any people who encounter the same problem. Though it of course raises the question, is the XHTML incorrect in someway to cause IE to barf, or is IE barfing incorrectly?
 
Version information:
CGI Version: 2.79
Perl Version: This is perl, v5.6.1 built for i686-linux
Web server: Apache 1.3.22 with mod_perl 1.26
 
Rob
 

Reply via email to