PDA

View Full Version : IE support for xhtml



lruc
10-27-2008, 01:34 PM
My recent project was actually one my mom has assigned to me. She just started some sort of buisness and asked me to make her a website(since I'm the only one in the house that doesn't think a computer is run by a midget). Anyways, I was seeing whether I should use xhtml or html. On an article I read on the web it stated Internet Explorer doesn't support xhtml. Is this true?

maxorator
10-27-2008, 01:50 PM
IE supports XHTML partially. It doesn't support the specific mime type (application/xhtml+xml), but you can make an XHTML site without the correct mime type too. This is how a traditional XHTML 1.1 page could start like:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head>
<meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8" />
<title>Your title here</title>
<script src="yourscript.js" type="text/javascript"></script>
<style type="text/css" media="all">
@import "yourstyle.css";
</style>
</head>


XHTML 1.0 is more popular (due to having a "Transitional" version), but 1.1 is my personal preference.

lruc
10-27-2008, 01:52 PM
Would you suggest it for a modern website?

maxorator
10-27-2008, 02:00 PM
Sure. XHTML has gained a lot of popularity in the recent years. XHTML actually makes a lot more sense than HTML since all tags have a start and an end (sometimes using the " />" tag end). It is also oriented to use CSS for more things than HTML does (the principle is that tags have no hardcoded features - only default CSS properties which can be changed). This is also good for the readability of the code.

Elysia
10-27-2008, 02:26 PM
You should note that many XHTML supporters / users scoff at using the typical HTML signature for XHTML, because it isn't right. But it is also the only way to get IE to support it.
Be sure to test the site rigidly to see if it works well in IE or make a choice - support IE or not.
I wish you the best of luck in that.
Darn Microsoft... *grumble*

jwenting
10-28-2008, 02:20 AM
there's always idiots who don't understand that the syntax IE supports IS correct XML (apart possibly from the missing <?xml declaration, can't remember if IE balks over that, or maybe only older versions did).

They're probably the same zealots who think IE isn't standards compliant because it supports things that aren't part of the standard while also supporting the standard (or more frequently they don't seem to know the standard, just assuming IE doesn't support it because it doesn't support something FF supports that on closer investigation happens to not be part of the standard).

Elysia
10-28-2008, 05:54 AM
Sorry, that is incorrect.
IE simply parses XHTML as HTML and ignores the typical / or non-existent HTML tags.
XHTML should be parsed different than HTML, with a different engine, so to speak. Therefore, it should be served as XHTML, not HTML.
XHTML 1.0 has backwards compatibility that enabled it to be served as HTML, not newer versions do not. They should not be served as HTML.

maxorator
10-28-2008, 06:01 AM
there's always idiots who don't understand that the syntax IE supports IS correct XML (apart possibly from the missing <?xml declaration, can't remember if IE balks over that, or maybe only older versions did).

They're probably the same zealots who think IE isn't standards compliant because it supports things that aren't part of the standard while also supporting the standard (or more frequently they don't seem to know the standard, just assuming IE doesn't support it because it doesn't support something FF supports that on closer investigation happens to not be part of the standard).
I'm not going to list all problems with it, I'll just give you one link that should pop up a normal webpage saying "Hello world" instead of offering a download.
XHTML test (http://bcup.pri.ee/xhtml.php)

CornedBee
10-28-2008, 07:06 AM
Just valid, strict HTML 4.01. It has no drawbacks compared to XHTML and has the advantage of really being supported by IE.

Elysia
10-28-2008, 07:15 AM
I would rather go XHTML. It seems to wipe out all those inconsistencies and stuff from HTML and it much more strict.
But regardless of HTML or XHTML, be sure not to use too new features or stuff, since they will leave IE in the dust, seeing as it has such poor standards support...

CornedBee
10-28-2008, 07:30 AM
It seems to wipe out all those inconsistencies and stuff from HTML
There are no inconsistencies in HTML 4.01 that aren't also in XHTML 1.0. There are a few rules that can cause confusion if exploited, but they're still consistent.
That said, you don't have to use any of those rules. In particular, you don't need to omit ending tags of non-nesting tags just because you're allowed to.


and it much more strict.
Also not true. Typical XHTML processors are more strict than typical HTML processors, but to even get there you need to send the file as application/xhtml+xml, which you can't do because of IE.
Nothing prevents you from writing an HTML processor that bails out on the first error.

Elysia
10-28-2008, 07:33 AM
Well, I digress. I simply like it being strict, no margin for optional omitting tags, etc.

sean
10-28-2008, 03:04 PM
Thanks Elysia. You're a programming master! How the hell do you know every thing?