You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by "Rob Mueller (fastmail)" <ro...@fastmail.fm> on 2001/12/28 01:17:29 UTC

CGI module bug, Internet Explorer 6 problems and workaround...

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


Re: CGI module bug, Internet Explorer 6 problems and workaround...

Posted by Jean-Michel Hiver <jh...@mkdoc.com>.
> 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?

I do work on a product (http://www.mkdoc.com) which outputs mainly valid
XHTML, and it works fine with any browser basically. Have you tried to use
an XHTML validator on the XHTML code that is being generated?

Cheers,

--
IT'S TIME FOR A DIFFERENT KIND OF WEB
================================================================
  Jean-Michel Hiver - Software Director
  jhiver@mkdoc.com
  +44 (0)114 221 4968
================================================================
                                      VISIT HTTP://WWW.MKDOC.COM