A user account is required in order to edit this wiki, but we've had to disable public user registrations due to spam.

To request an account, ask an autoconfirmed user on IRC (such as one of these permanent autoconfirmed members) or send an e-mail to admin@wiki.whatwg.org with your desired username and an explanation of the first edit you'd like to make. (Do not use this e-mail address for any other inquiries, as they will be ignored or politely declined.)

XHTML2 versus HTML5

From WHATWG Wiki
Jump to: navigation, search

This document is obsolete.


This is not about HTML versus XHTML, instead this page is an attempt to find out where XHTML2 and HTML5 features overlap, why certain design decisions in HTML5 have been made different, and why HTML5 lacks certain features XHTML2 has.

It is not an attempt to demonstrate that 5 > 2. We know that.

It is also very simple at this point. I wish my time was infinite.

XHTML Document Module

The html element

XHTML2 has version="" and xsi:schemaLocation="". HTML5 has neither.

Rationale: HTML5 does away with versioning in HTML defining it equivalent to CSS in that regard. XXX add something nice about why we do not have xsi:schemaLocation=""

The head element

XHTML2 has profile="". HTML5 has not.

Rationale: it does not appear to be used in the wild.

Note: this is still being debated by the HTML WG.

XHTML Structural Module

The blockcode element

HTML5 does not have this element. In HTML5 you can use <pre><code> instead.

Rationale: the blockcode element is not backwards compatible.

The heading elements

HTML5 does not have the h element. In HTML5 the h1-h6 elements work together with the section element. In XHTML2 only the h element works with the section element.

Rationale: the h element is not backwards compatible. Also, it seems important to define interaction between the h1-h6 elements and the section element so authors can more easily reuse existing content and assistive technology can still make sense of invalid pages.

The separator element

HTML5 does not have the separator element. It does have the hr element which means and does the same thing.

Rationale: the separator element is not backwards compatible and we cannot do away with the hr element so adding an equivalent element would just make matters more complex.

XHTML Text Module

The abbr element

XHTML2 has a full attribute that can reference another element which provides the expansion (within the same page). HTML5 does not. HTML5 does this implicitly by comparing element contents.

Rationale: Less work for authors.

The l element

XXX The XHTML2 open issues list says that the br element will be added back. Does this element stay though?

XHTML Hypertext Module

XXX This module talks about adding the access element to the head element, but the link is broken.

XHTML List Module

HTML5 does not have a a caption element to annotate list items.

Rationale: XXX

The dl, di, dt and dd elements

HTML5 does not have the di element. (HTML5 is much clearer in defining this, by the way.)

Rationale: the di element solves a styling problem.

The nl element

HTML5 does not have the nl element.

Rationale: XXX

XHTML Core Attributes Module

The xml:id attribute

HTML5 does not have this attribute, however, xml:id can be used in XHTML5 web pages.

Rationale: there already is an id attribute that works fine and can be used both in HTML and XHTML web pages whereas xml:id can only be used in XML documents.

The layout attribute

HTML5 does not have this attribute.

Rationale: the pre element can be used instead.

XHTML Hypertext Attributes Module