Solved

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

Posted on 2004-08-05
15
237 Views
Last Modified: 2013-12-16
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
0
Comment
Question by:fschirrmeister
  • 6
  • 6
  • 2
15 Comments
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 11744323
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&
0
 

Author Comment

by:fschirrmeister
ID: 11747497
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?
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 11747674
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&
0
 
LVL 31

Expert Comment

by:seanpowell
ID: 11747749
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>
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 11747783
Sean,

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

Cd&
0
 
LVL 31

Expert Comment

by:seanpowell
ID: 11747869
Well that's interesting - on my IE6 it just prints out the source code.
0
 
LVL 31

Expert Comment

by:seanpowell
ID: 11747887
Also - just looked at my test page above - sorry, remove the xml prologue:

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 11747889
What OS?

Cd&
0
 
LVL 31

Expert Comment

by:seanpowell
ID: 11747896
XP Pro...
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 11747909
I thought so.  I'm using w2k.

Cd&
0
 
LVL 31

Expert Comment

by:seanpowell
ID: 11748055
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 :-)
0
 

Author Comment

by:fschirrmeister
ID: 11757165
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.
0
 
LVL 31

Accepted Solution

by:
seanpowell earned 125 total points
ID: 11757279
Yes - IE and the prologue are not good bed partners. It's also optional, and forces IE into into quirks mode, so I would just remove it.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 12191793
Sean I think.

Cd&
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Summernote required 3 102
android app- saved password.. 7 44
Browser annoying behavior 18 50
Could you possibly point a workaround on this jQuery/ plugin datatable error? 5 42
I had to do a bit of research to find the answer to this question so I thought I'd share my results.  Due to our outdated mainframe systems, we need to downgrade IE9 to IE8 in order to stay compatible.  We also needed to downgrade Java.  In order to…
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…
This Micro Tutorial will demonstrate how nuggets on the Web are formatted by using Chrome Developer Tools. These tools would not only view the site's CSS but it can also modify it and save the CSS to use on your own site.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now