[thelist] Re: IE 6 displays XML code when I submit a form from an XHTML page

Sarah poohbear at designshift.com
Mon Jan 27 08:00:12 CST 2003


>I am developing a new site with XHTML and ColdFusion. I have a login form
>which, when it is filled in and submitted (but not if the form isn't
>filled in), shows me the XML for the submit page, rather than the rendered
>HTML. But, as far as I can tell, this only happens in IE 6. I can't
>provide a link to the actual form, cause it is on our intranet. Here is a
>copy of the XHTML for the form:
>http://sarah.designshift.com/hp-test/index.html
>And here are screenshots of what the submit page _should_ look like and
>what it _does_ look like:
>http://sarah.designshift.com/hp-test/expected.jpg
>http://sarah.designshift.com/hp-test/unexpected.jpg
>
>Here is the beginning of the XHTML:
><?xml version="1.0" encoding="iso-8859-1"?>
><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>... The "offending" line in this seems to be: <?xml version="1.0"
>encoding="iso-8859-1"?> If I remove this line, everything works as it
>should, but I would rather not remove the line if I can avoid it. Any
>ideas on how to fix this problem without removing the <?xml...?> tag would
>be appreciated. TIA Sarah

In case anyone is curious about this, I found a solution. It seems that
ColdFusion's tendency to output extra whitespace to the browser was the
culprit here (this is CF 4.5, I've heard that CFMX doesn't have this
problem). The extra lines before the <?xml...?> line were causing the page
to output incorrectly in IE 6 because the XML declaration is supposed to be
the very first line in the page. I solved this by using the <cfsetting> tag
in my Application.cfm file so that no extra whitespace would be output
before the XML declaration.

Sarah




More information about the thelist mailing list