XHTML1.0 vs XHTML 1.1

Ok. :slight_smile:

I got the error message that anjanesh posted a screenshot of.

Which one? The IE7 screenshots in #45 and #51 aren’t error messages as far as I can tell.

I was referring to #56. I see #45 and #51 as well when that registry key isn’t in the registry.

Hmm… http://img201.imageshack.us/img201/6462/iexhtmltesthp6.gif (the image in #56) doesn’t load for me. :frowning: What does it say?

I reuploaded the image - smaller version


Internet Explorer cannot download blog.php from www.autisticuuckoo.net.

Internet Explorer was not able to open the Internet site. The request site is either unavailable or cannot be found. Please try again later.

Ok. That’s not what I get…:

The XML page cannot be displayed

Cannot view XML input using style sheet. Please correct
the error and then click the Refresh button, or try again
later.

Parameter entity must be defined before it is
used. Error processing resource
http://www.w3.org/TR/xhtml1

%xhtml-prefw-redecl.mod; -^

Now, here is a blog that serves pure application/xhtml+xml : http://plasmasturm.org/ - found by jcheng.

So does my blog, to browsers that claim to prefer it.

But your blog seems to show up in my IE like this:

while plasmasturm.org prompts to download, saying unknown file-type.

That’s right. I examine the Accept HTTP header that a user agent sends in hte GET request. Browsers that say they prefer application/xhtml+xml (e.g., Opera and Firefox) get an XHTML document served as such. Others (e.g., IE) get an HTML document served as text/html. Safari/Mac doesn’t claim to prefer XHTML, so it gets HTML, but the Safari/Win beta says it prefers XHTML and gets that. Unfortunately it cannot handle it properly, but that’s Apple’s problem, not mine. :slight_smile:

You can override my content negotiation by appending a query parameter (xml=yes for XHTML or xml=no for HTML). Try adding ?xml=yes to the URL in IE and see what happens. :wink:

I don’t use php / asp etc (just static xhtml pages) and therefore cannot code this logic into the MIME type served.

However I want to take advantages of the xhtml benefits on the browsers that support application/xhtml+xml

Can I not simply do the following:

Does Microsoft Internet Explorer accept the media type application/xhtml+xml?
No. However, there is a trick that allows you to serve XHTML1.0 documents to Internet Explorer as application/xml.

Include at the top of your document the line in bold here:

<?xml version=“1.0” encoding=“iso-8859-1”?>
<?xml-stylesheet type=“text/xsl” href=“copy.xsl”?>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=“http://www.w3.org/1999/xhtml”>
<head>
where copy.xsl is a file that contains the following:

<stylesheet version=“1.0”
xmlns=“http://www.w3.org/1999/XSL/Transform”>
<template match=“/”>
<copy-of select=“.”/>
</template>
</stylesheet>
Note that this file must be on the same site as the document referring to it.

Although you are serving the document as XML, and it gets parsed as XML, the browser thinks it has received text/html, and so your XHTML 1.0 document must follow many of the guidelines for serving to legacy browsers.

Your XHTML document will continue to work on browsers that accept XHTML 1.0 as application/xml.

Source:
http://www.w3.org/MarkUp/2004/xhtml-faq#advantages

But there aren’t any advantages in this case. Yes, you can use an identity XSLT transform for IE, but that means you cannot use any of the advantages (like other XML namespaces) in your XHTML markup, since it must be possible to transform straight into HTML.

Using the identity transform you need to serve the document as application/xml rather than application/xhtml+xml, since IE doesn’t support the latter.

The main disadvantage of this approach is that it requires client-side XSLT. Not all browsers support that.

Serving trivial XHTML as application/xhtml+xml to modern browsers is no advantage at all. Quite the opposite, really. The slightest well-formedness error will give Firefox users a YSOD, and even if it’s well-formed they won’t get incremental rendering (unless Firefox supports that now, but I don’t think so). I believe Opera supports incremental rendering for XHTML, but I don’t know about Safari.

thanks for the quick reply…

Ok so as I am about to spent alot of time becoming proficient at coding strict standards compliant websites what do you recommend I learn?

It seems that HTML 4 strict is the best option with the most browser compatibility, and simplest implimentation (i.e. no changing MIME types etc)

However deep down I feel like I will be missing out on something cool if I leave off the x :slight_smile:

…also I am planning to build alot of sites, perhaps a few hundred so if I go for XHTML but served as html would that be better in the long run? I could essentially change the way my pages are served to proper XML.

This way would I have more chance that the websites would be more future proof?

I would hate to have to transform them all in a few years to take advantage of some cool browser feature or xml feature…

Actually it doesn’t; it requires support for either XSLT and HTML, or XHTML (supporting both will work fine, too).

I would say that the main disadvantage is that it won’t render incrementally in any browser (including IE). The XSLT file and the “source” XML file both have to load completely before the tranformation can be performed, IIRC.

Or perhaps the main disadvantage is the complete poinlessness of doing it? :slight_smile:

Firefox 3 will support incremental rendering of XHTML (in the general case, at least).

HTML 4.01 Strict (plus CSS 2.1 and DOM Level 2).
It’s the latest recommendation that is reasonably well-supported by contemporary browsers.

Believe me, you’re not.

It won’t be better in the long run, but of course you can do it if you want to. Before you do, though, make sure that you really understand the profound differences between XHTML and HTML and study Appendix C of the XHTML 1.0 specification very carefully.

No. If XHTML ever becomes useful, it won’t be XHTML 1.x but some other version. It will most likely not be backwards compatible with HTML or XHTML 1.x, so you will have to rewrite your documents anyway if you want to ‘upgrade’.

You’re right. If the xml-stylesheet PI isn’t supported, it will be handled as XHTML.

Living in the future as always. :wink:
HTML5 will do this … CSS3 will provide that … Firefox 3 will support the other …
:lol:

thanks!

I will go with your recommendations

“HTML 4.01 Strict (plus CSS 2.1 and DOM Level 2).
It’s the latest recommendation that is reasonably well-supported by contemporary browsers.”

:cool:

You bet! :smiley:

I just read some great FAQs about xhtml and html. You can look upto to it. Thanks.

Hi all,

What’s the difference between the above standards?

Which should be used in webpages?

Thanks.

Moremony services