Scott Baker
Scott Baker

Reputation: 10443

XHTML Not Displaying in IE6, 7, 8 or FF3.5.1 - but ok in Firefox 3.0.1

I have an XML file that references an XSL file (like ya do) that until lately has generated perfectly acceptable HTML output, regardless of browser.

A new requirement has come down from on high for XHTML output for compatibility with another product. Ok, fine - I reworked my stylesheet to produce (W3C Validated) XHTML.

Previously, I would open my XML file and view the transformed output just fine in IE and FF. Now, I get all kinds of troubles. IE6, 8 and 8-in-IE7 mode display a completely blank page. Firefox 3.5.1 displays just the text nodes, completely devoid of formatting. Firefox 3.0.1 displays the page (almost) normally - aside from a white border around the page and the JavaScript doesn't work.

Anyone know why? Here is the beginning of the XHTML output file:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC 
          "-//W3C//DTD XHTML 1.0 Transitional//EN" 
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml" 
      xmlns:ftid="http://www.boeing.com/FTID-ML" 
      xmlns:rev="http://www.boeing.com/FTID-ML/Revision" 
      xmlns:xlink="http://www.w3.org/1999/xlink">

Upvotes: 0

Views: 1155

Answers (4)

Scott Baker
Scott Baker

Reputation: 10443

The problem, believe it or not, was my title element.

<title />

doesn't work. IE freaks out, loses it's little mind and doesn't display anything.

<title> </title>

cured the problem. Further information: IE is doing just fine having the XML declaration at the top...

Upvotes: 1

hhaamu
hhaamu

Reputation: 7331

  • Check that your inline javascript/css is in a CDATA block (and not "commented out")
  • white border around page: XHTML doesn't treat the "html" element differently. You should set html { background-color: #f5f5f5; }, not body { background-color:#f5f5f5; }
  • check your content-type. older IEs don't support application/xhtml+xml at all, but want text/html

Upvotes: 1

ykaganovich
ykaganovich

Reputation: 14964

Check that you're reporting correct content type in the HTTP response. Should be application/xhtml+xml

Upvotes: 1

jimyi
jimyi

Reputation: 31191

Having the XML declaration above the DOCTYPE forces IE6 into quirks mode, so that explains why it's not working properly in IE6. I can't speak for the other browsers. It might help to show us some more code.

Upvotes: 2

Related Questions