Link to home
Start Free TrialLog in
Avatar of fschirrmeister
fschirrmeister

asked on

Internet Explorer does display .xhtml files as source, not as content.

Hi -

I am running Internet Explorer 6.0.2800.1106.  I am trying to display a .xhtml file but the source get displayed (example below)

  <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
  <!DOCTYPE html (View Source for full doctype...)>
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

When I rename the file as a .html file the the document is displayed fine.

Is there a setting in IE with which I can enable the display of .xhtml file? Perhaps in the security settings?

Thanks. Regards, Frank
Avatar of COBOLdinosaur
COBOLdinosaur
Flag of Canada image

In windows explorer right click the xhtml file.  Then select open with.  The that will bring up an application list.  Select Internet Explorer, and chech the checkbox that says always open use for these files the click open.  Now xhtml is associated with IE

Cd&
Avatar of fschirrmeister
fschirrmeister

ASKER

This is not about file association (which was already correct). It opens the .xhtml file in IE but displays the .xhtml source, not the document as it is intended to view. As workaround I have installed FireFox and it works just fine there.

Any way to display .xhtml in IE?
It works fine for me in IE6, so there is either something in the actual file that IE does not like or there is a wrong setting somewhere.  I don't have a clue what the setting might be, but nothing else makes senses.  When IE dumps the source it is most often a screwed up file, but then Mozilla based browsers should trip over it as.

I can't duplicate the problem so I don't know how to fix it.

Cd&
Avatar of seanpowell
It looks like you're missing some information there...

Try this basic test file, saved as test.xhtml:


<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
<head>
<title></title>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
</head>
<body>
Hello, World    
</body>
</html>
Sean,

When I used the snippet posted even with the grossly invalid doctype IE renders.

Cd&
Well that's interesting - on my IE6 it just prints out the source code.
Also - just looked at my test page above - sorry, remove the xml prologue:

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
What OS?

Cd&
XP Pro...
I thought so.  I'm using w2k.

Cd&
Really - w2k parses the file? I guess they got a little stricter with XP.
About time they got strict with something.

Sorry fschirrmeister for the side track - we're just exploring what's going on :-)
FWIW, if i use the "Hello World" testfile the original produces again the source. If I remove the xml prologue then it displays the Hello World just fine. I am running XP Pro TabletPC.
ASKER CERTIFIED SOLUTION
Avatar of seanpowell
seanpowell
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Sean I think.

Cd&