HTML 5 or XHTML?
Moderator: General Moderators
- greyhoundcode
- Forum Regular
- Posts: 613
- Joined: Mon Feb 11, 2008 4:22 am
HTML 5 or XHTML?
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?
- jayshields
- DevNet Resident
- Posts: 1912
- Joined: Mon Aug 22, 2005 12:11 pm
- Location: Leeds/Manchester, England
Re: HTML 5 or XHTML?
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
- JAB Creations
- DevNet Resident
- Posts: 2341
- Joined: Thu Jan 13, 2005 6:44 pm
- Location: Sarasota Florida
- Contact:
Re: HTML 5 or XHTML?
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.
- jayshields
- DevNet Resident
- Posts: 1912
- Joined: Mon Aug 22, 2005 12:11 pm
- Location: Leeds/Manchester, England
Re: HTML 5 or XHTML?
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.
- JAB Creations
- DevNet Resident
- Posts: 2341
- Joined: Thu Jan 13, 2005 6:44 pm
- Location: Sarasota Florida
- Contact:
Re: HTML 5 or XHTML?
I think I read it wrong, my bad. I don't disagree actually now that I reread your post. 
Re: HTML 5 or XHTML?
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"?
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"?
- jayshields
- DevNet Resident
- Posts: 1912
- Joined: Mon Aug 22, 2005 12:11 pm
- Location: Leeds/Manchester, England
Re: HTML 5 or XHTML?
Your website is being served as text/html, which basically means that it's being processed as HTML by browsers, not XHTML.
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.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).
Re: HTML 5 or XHTML?
I do like the doctype of html5:
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.
Code: Select all
<!DOCTYPE html>
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.