Pete Freitag Pete Freitag

What's New in XHTML2

Updated on December 06, 2023
By Pete Freitag
web

According to the W3C the next version of XHTML - is going to "last call real soon now". Steven Pemberton the Chair of the W3C Working Group has posted a presentation on XHTML2 on the W3C web site. The presentation shows some cool new features in XHTML 2...

IMG tags

The IMG tag was not part of the original HTML, and was badly designed according to Pemberton. So in XHTML2 any element can have a src attribute, the inner content of the attribute is used as a fall back if images are disabled, and also serves as the alt and longdesc for the image. So for example:

<p src="ipod.jpg">
 The ipod is a white mp3 player about the size of a deck of cards
</p>

Structure - Sections and Headings

When you think about the h1, h2, etc tags, they feel un-normalized - as if you were creating a database table, and instead of crating another table for properties, you created a column for a fixed number of properties.

Additionally it is difficult for blind people to derive structure from a HTML web page. Often the only clue is the level of header used (h1, h2 etc), and often they are not used correctly.

In XHTML version 2 this is solved with the addition of the section and h tag.

<section>
  <h>The Heading</h>
  <p>Some content</p>
  <section>
	<h>A sub section</h>
	<p>Sub content</p>
  </section>
</section>

Separator's

The separator tag was created:

hr is not presentational, but structural: a lightweight section separator.
The only thing wrong with hr is that it is not (necessarily) horizontal, and not (necessarily) a rule!
We already needed a separator element for navigation lists, so we just decided to do away with all the confusion and rename hr to separator.

The role attribute

The role attribute can be used on any element to specify what an element is for. For instance

<div role="navigation">...</div>

This is a great feature for those looking to create semantic web pages. Elements can have specific meanings that would presumably be predefined by other standards. Steven suggests that using role's could replace the need for RSS. Not that its going anywhere, anytime soon.

Meta Data

The attributes in the meta, and link tags can be used on any element, so you can create smaller documents by saying that the title tag is also this h tag:

<h property="title">This is the title of my document</h>

Paragraphs

The p tag now allows much more to be inside of it, such as lists.

There are many more tags not covered in the presentation, such as:

  • The line tag instead of br
  • The quote tag instead of q
  • New list type nl for navigational lists, or menus.

The goals of XHTML2 were to be more Accessible, Usable, Device Independent and Semantic.



xhtml xml xhtml2 w3c

What's New in XHTML2 was first published on May 31, 2005.


Discuss / Follow me on Twitter ↯

Comments

Looks definitely more descriptive! Which is good in the long run. I wonder how we can control the src attributes' postioning with the content it's attached too.

How long do we expect an press-release announcement that browsers/web-development applications should impliment? 1 year? 1 years? IE7 is already on its' way for this year; Firefox 1.1 is sometime this year (2005) also. What does everyone think?
by Chris Charlton on 05/31/2005 at 2:36:43 PM UTC
It will be IE 8 at very least before this is available, and probably firefox 2.1 or more. Also, that is assuming that css 3 catches up with this and allows rules and styling for these new elements. Its something to definately look forward to, but in a day where I would venture to say less than 10% of the web is even using xhtml 1.0, its not going to matter much anytime soon unfortunately. I'll definately be ready though!
by Ryan Guill on 05/31/2005 at 3:05:34 PM UTC