Page 1 of 1

HTML 5 or XHTML?

Posted: Thu Feb 26, 2009 8:39 am
by greyhoundcode
Possibly a bit of a wildcard question this, but is there any reason to prefer XHTML output over HTML 5, apart from personal preference that is? Or indeed is the reverse true?

Re: HTML 5 or XHTML?

Posted: Thu Feb 26, 2009 1:07 pm
by jayshields
Proper XHTML isn't a good idea if you want your website to render correctly in all browsers. Internet Explorer is holding the World back, some things never change. Although there is a hack here http://www.w3.org/MarkUp/2004/xhtml-faq#ie

Re: HTML 5 or XHTML?

Posted: Mon Mar 02, 2009 6:22 pm
by JAB Creations
Wrong! You can still serve your website as application/xml which is allowed whereas text/html is not. It'll still break like XHTML. HTML5 is frankly a joke from the things I've read. Plus you can use XHTML 1.1 correctly now. Don't let Internet Explorer dissuade you from higher better standards.

Re: HTML 5 or XHTML?

Posted: Mon Mar 02, 2009 6:34 pm
by jayshields
Sorry, what's wrong about my statement? If you serve XHTML as application/xhtml+xml like it is meant to be served as, IE doesn't render it.
XHTML Frequently Asked Questions wrote:Does Microsoft Internet Explorer accept the media type application/xhtml+xml?

No.
XHTML Media Types wrote:This document summarizes the best current practice for using various Internet media types for serving various XHTML Family documents. In summary, 'application/xhtml+xml' SHOULD be used for XHTML Family documents, and the use of 'text/html' SHOULD be limited to HTML-compatible XHTML 1.0 documents. 'application/xml' and 'text/xml' MAY also be used, but whenever appropriate, 'application/xhtml+xml' SHOULD be used rather than those generic XML media types.

Re: HTML 5 or XHTML?

Posted: Mon Mar 02, 2009 7:17 pm
by JAB Creations
I think I read it wrong, my bad. I don't disagree actually now that I reread your post. :P

Re: HTML 5 or XHTML?

Posted: Mon Mar 02, 2009 8:19 pm
by omniuni
So, I'm kind of confused here. I designed my website http://omniimpact.com using XHTML 1.0. With just a tiny tweak, I updated it to 1.1. The W3C validator doesn't seem to have a problem with it: http://validator.w3.org/check?uri=http% ... impact.com

To my knowledge, this website displays in IE. Does it not? Should I be aware of something that I am missing?

HTML 5 is still quite a ways off, XHTML is here already. I have been starting to use it on all of my websites.

Am I doing something wrong that is making it "work"?

Re: HTML 5 or XHTML?

Posted: Tue Mar 03, 2009 4:20 am
by jayshields
Your website is being served as text/html, which basically means that it's being processed as HTML by browsers, not XHTML.
XHTML Media Types - Second Edition wrote:The 'text/html' media type [RFC2854] is primarily for HTML, not for XHTML. In general, this media type is NOT suitable for XHTML except when the XHTML is conforms to the guidelines in Appendix A. In particular, 'text/html' is NOT suitable for XHTML Family document types that add elements and attributes from foreign namespaces, such as XHTML+MathML [XHTML+MathML].

XHTML documents served as 'text/html' will not be processed as XML [XML10], e.g., well-formedness errors may not be detected by user agents. Also be aware that HTML rules will be applied for DOM and style sheets (see guidelines 11 and 13).
I don't know much about HTML5 so I'm not really bringing that into the argument, all I really know is that it's definately not ready for production use yet.

Re: HTML 5 or XHTML?

Posted: Tue Mar 03, 2009 5:44 am
by matthijs
I do like the doctype of html5:

Code: Select all

<!DOCTYPE html>
 
Much better.

The cool thing is, you can start using that even today. it’s safe to use <!doctype html> to get standards-mode rendering in pretty much any web browser. At last a doctype I can remember.

And then there's the more semantic markup like <section>, <article>, etc

However, it will be a long time before HTML 5 is fully supported and until using it has advantages over current standards. So for now HTML 4 is fine.