Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

So what happened to XHTML5?

http://www.w3.org/TR/html5/

That page is a draft for both xhtml5 and html5? So there's no difference between these doctypes?

share|improve this question
add comment

4 Answers

up vote 42 down vote accepted

W3C decided to abandon XHTML for HTML 5. This decision is motivated by several reasons:

  • Only few people were really interested in XHTML. Most of the websites were written in plain HTML.

  • Even fewer really understood what XHTML is about and how to use it. Too many websites which pretended to serve XHTML used wrong headers, instead of Content-Type: application/xhtml+xml.

  • Even when you fully understand what XHTML is and what must be the headers, the thing is really tricky with some crappy browsers not accepting/supporting application/xhtml+xml content type. This meant that you had to change the header according to the browser.

  • The XML part of XHTML also caused some weird situations the developers had to solve. One is INVALID_STATE_ERR: DOM Exception 11 message appearing when you assign the text containing HTML characters (like é) to an element within the XHTML page. When you encounter this error with its very helpful message in a large web application after doing an AJAX request, you have really no idea if it's the fault of JQuery, AJAX, or something else.

  • Writing HTML 5 code doesn't mean mixing up tags all around. If you're passionate about XML and XHTML, you can still write HTML 5 code which will look very close to XML.

  • In the early days of mobile phones, XHTML was interesting for the mobile devices which were not very powerful. Parsing XML is much easier than HTML. Now, with dual-core mobile devices, it really doesn't matter if they have to parse clean valid XML or dirty HTML full of hacks and mixed tags.

share|improve this answer
6  
I think the only thing your answer is missing is a reference to polyglot markup –  Yannis Rizos May 23 '12 at 15:21
    
The JSF specification declares conformity to XHTML standards and many JSF based web applications still use the extension. Note this doesn't preclude some clever JSF component development occurring with HTML5 as well, but it isn't entirely abandoned as some think. –  maple_shaft May 23 '12 at 16:52
    
@maple_shaft However the JSF specification is not the W3C's problem, is it? –  Roc Martí May 23 '12 at 19:20
    
You can serve HTML5 as XML, however, and gain the benefit of stricter syntax. –  Erik Reppen Mar 7 '13 at 1:49
1  
@ErikReppen but you'll lose the benefit of entity references like   –  Mr Lister Dec 17 '13 at 15:54
add comment

For all intents and purposes, XHTML has been abandoned.

There is no XHTML 5 and there will not be one.

share|improve this answer
add comment

Yes unfortunately XHTML is gone.

Adding 1 more reason to MainMa's great answer:

When XHTML was created, it was meant to be used by WebApps to serve structured content that would be understood by non-browser softwares, that would not have tag-soup HTML parsers. For ScreenReaders XHTML is still great, but for any other kind of software, WebServices fit that need, and they mostly use XML or JSON. SOAP itself has its own XML Schema, simpler than XHTML and operation-oriented.

As long as I know, there's not even 1 WebApp in the world that serves the same HTTP message to both browsers and other clients. Even REST architecture, which was meant to serve the same representation of a content in multiple content types based on client's preference, isn't used to serve XHTML/feed browsers.

In Java EE for exemple, using Eclipse we can deploy a unique war file holding Servlets+JSPs to serve HTML, together with Axis2 to serve a WebService. It's simply easier to develop separated softwares aimed for browsers and WebService than have a unique, complex software that serves them all.

The major reason for REST being rejected is exactally the complexity (and it was meant to be simple!) of developing a server that serves the same content for any type of client without knowing anything about it. And it's also hard to handle Web's need of fast evolving, together with keeping a stable definition that would not force non-browser clients to be updated everytime a XHTML changes, say it to keep the XHTML valid when it's built by many different modules.

In the same way, it's very harder to develop a non-browser client that parses a XHTML document, even it being valid, because of all those XML elements that are meant to structure the browser-rendered layout, and not meant to hold content.

If REST adopters already complain about SOAP's XML complexity, which is WAY simpler than a XHTML meant for a browser, imagine how hard it is to handle XHTML for multiple client types, server and client-side.

In practice: use HTML, XML-like if you want, to build WebSites for browsers, and any kind of WebService solution for non-browser clients.

BUT, I also think that XHTML5 must be created. XHTML 1.1 (ok, 1.0, 1.1 is unusable) will become outdated with HTML5, and we still need a validator that accepts HTML5's elements and validates XML wellformedness.

share|improve this answer
    
Maybe I'm a bit late, but how is XHTML 1.1 unusable compared to 1.0? If anything, its DTD contains more elements. Unless you're talking about framesets and things like that? –  Mr Lister Dec 17 '13 at 15:58
add comment

XHTML5 is a synonim for HTML5 serialized as XML.

There are various concrete syntaxes that can be used to transmit resources that use this abstract language, two of which are defined in this specification.

...

The second concrete syntax is the XHTML syntax, which is an application of XML. When a document is transmitted with an XML MIME type, such as application/xhtml+xml, then it is treated as an XML document by Web browsers, to be parsed by an XML processor. Authors are reminded that the processing for XML and HTML differs; in particular, even minor syntax errors will prevent a document labeled as XML from being rendered fully, whereas they would be ignored in the HTML syntax. This specification defines version 5.0 of the XHTML syntax, known as "XHTML 5".

quoted from http://www.w3.org/TR/html5/introduction.html#html-vs-xhtml (Note that is also says "This section is non-normative.", and even further further it says that "At the time of writing, no such rules actually exist." about XHTML5 parsing rules)

Also, there's a nice document on writing HTML5 polyglots (pages, that can be serialized both as regular HTML5 and XML)

http://dev.w3.org/html5/html-polyglot/html-polyglot.html#bib-HTML5

And a validator even!

http://html5.validator.nu/

It's rarely called XHTML5 nowadays (and probably even more seldom used), since it's basically still HTML5 but it's still there.

Simply put, every change to HTML5 spec is also an implicit, corresponding change to XHTML5.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.