Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 341181 - XHTML (with XML Decl) can not open in internal web browser
Summary: XHTML (with XML Decl) can not open in internal web browser
Status: RESOLVED NOT_ECLIPSE
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: wst.html (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: wst.html CLA
QA Contact: Nick Sandonato CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-28 22:45 EDT by David Williams CLA
Modified: 2011-03-30 00:15 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Williams CLA 2011-03-28 22:45:19 EDT
I think this has been a problem for a while ... maybe even in Helios SR2? ... and always figured it was "my setup", somehow. But, tonight I investigated some, with Indigo M6, and it appears to be the file contents. 

An XHTML file, that starts with an XML Decl (as every good XHTML file should) does not "open with..." the (internal) web browser. External web browser works ok, if preferences are set that way. 

Following a simple "new file" and using XHTML template should demonstrate the problem. I ended up with one called "newFile.html" with contents pasted below. 

The (internal) web browser opens, but the URL line is empty (and the contents of browser is empty). 

Not sure _where_ the problem is ... but, figured the HTML/XHTML component would be a good place to open a bug. 

Note, also, that when I get "properties" on the file, it shows "HTML" (for all cases). 

= = = = this content does not "open" in browser = = = = 
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!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">
<body>
<p>test</p>
</body>
</html>

= = = = this content does "open" in browser = = = = 
<!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">
<body>
<p>test</p>
</body>
</html>


I tried Java EE, Java, and Resource Perspective, and all had same behavior. 

Marking as "major" since this is a loss of function.
Comment 1 David Williams CLA 2011-03-29 02:20:18 EDT
Maybe it is (partially?) my setup/machine? I can't get this to work with Helios either. Galileo and Ganymede don't work either! ... but, behavior is a little different ... there, the browser seems to be "spinning" like its trying to download DTDs, or something. Helios and Indigo don't spin, just quickly display nothing :) 

Can something this "bad" have existed for so long? And no one else reported it? That's partially why I think it might be related to my setup/machine, somehow. 

I did try disabling firewall, and seemed to have no effect.
Comment 2 David Williams CLA 2011-03-29 02:39:38 EDT
I've now tried this on another Windows 7 machine (and Linux) and it works fine (tried Helios SR1 and Indigo M6a) ... so, there is something off about the Windows 7 machine I'm using when I reported the bug. I guess the XML Decl line is just some odd interaction that allows it to open, when that line is removed. 

I've changed to 'normal', but this might easily turn out to be "not eclipse". 

Not sure what to check next ... maybe file associations? Other software installed? Odd.
Comment 3 Nick Sandonato CLA 2011-03-29 09:55:31 EDT
I've tried Helios and Indigo on an XP machine and haven't had issue with this. Does the file open fine if it's opened directly in IE outside of Eclipse?
Comment 4 David Williams CLA 2011-03-29 16:11:17 EDT
(In reply to comment #3)
> I've tried Helios and Indigo on an XP machine and haven't had issue with this.
> Does the file open fine if it's opened directly in IE outside of Eclipse?

That's a good suggestion, and no, it doesn't. Somehow, for some reason, even if I say 'open with IE" (from file navigator), then IE does open up, but the request is "redirected" somehow to Firefox! And that does not happen if XML Decl is removed (and does not happen on my other two Windows 7 installs). 

So, I'll close as "not eclipse", though still don't know what the problem is. I've compared "default programs", "add ons", and "file type" associations in the OS, and nothing seems "off" or different. But, I'll keep looking and update this entry if I ever figure out what it is.
Comment 5 David Williams CLA 2011-03-30 00:15:18 EDT
I've (finally) got this working again. I tried changing many settings and uninstalling lots of things, but, I think, in the end, the cure was just to reinstall internet explorer, using 

"C:\Windows\System32\ie4uinit.exe" -reinstall

(Which I ran across a "how to" by accident). 

I got a hint this might be required from reading 

http://en.wikipedia.org/wiki/Xhtml#Adoption

Where it says, among other things, 

"The notable exception [of supporting browsers] is Internet Explorer versions 8 and earlier by Microsoft; rather than rendering application/xhtml+xml content, a dialog box invites the user to save the content to disk instead."

So, I suspect the XML Decl is what makes IE know it is "application/xhtml+xml" and I suspect at some time in the past I did answer "yes, download, and do this automatically from now on", or something similar. (But, to be honest, I do not get the 'download' prompt, not that I have reinstalled). 

At any rate, I ran 
"C:\Windows\System32\ie4uinit.exe" -reinstall 
and nothing really noticeable happened (there were no dialogs, or anything, and my IE "defaults" all stayed the same) ... but ... it worked after that. I could  first opened the xml/xhtml file with IE, and then tried in "internal browser" and it worked fine. 

Some days I hate computers :)