XHTML, XForms and Device Independence

Steven Pemberton, CWI, Amsterdam and W3C

Chair, W3C HTML and Forms Working Groups

HTML: A success!

No one can deny that HTML has been a great success. But...

It is a mess. Both in its design and its use.

XHTML is trying to improve the situation.


XHTML is a family of XML-based markup languages.



We are currently working on a new member of the XHTML family, in our minds the 'real' XHTML.

Our aims are:

In fact as I will show, many of these things are intertwined.

Generic XML

By 'generic XML' we mean: if a facility exists in XML technologies, and it is suitable, use it and not a special-purpose XHTML facility. Try to get missing functionality added to XML.


Major missing functionality: Linking (XLink insufficient for XHTML's needs).

Device independence advantage: the generic features have been designed without reference to devices.

Less presentation

Remove all presentation-only markup.

Use stylesheets to define presentation.

Device independence advantage: possible to author once, and display on different devices; better presentation possibilities; device presentation not hardwired; CSS has support for devices

Power of CSS currently seriously underappreciated.

(Note: doesn't require CSS to be implemented; just uses its model)

More structure

Add more semantically-oriented markup to make documents richer.

Examples: <line> element instead of <br>. <section> and <h> elements instead of <h1> <h2> etc


I think that I shall never see<br>
A poem lovely as a tree


<line>I think that I shall never see</line>
<line>A poem lovely as a tree</line>

Device independence advantage: more presentational opportunities (folding, marquee)

More accessibility

This largely falls out automatically from other aims.

For instance <h1>, <h2> etc are mostly terrible for accessibility, because no one uses them right, and it is hard to work out document structure from so little information.

Structure/Accessibility example

<h2>Chapter 1</h2>
<h3>Section 1</h3>

is now:

<h>Chapter 1</h>
   <h>Section 1</h>

More structure gives more accessibility. So does device independence.

Less scripting

Observe how scripting is currently used.

Identify missing markup/functionality.

Add it where possible; try to cover 80% mark

Examples: menus for navigation; forms data checking; folding presentation.

Device independence advantage: less scripting, more presentational variations

More usability

Research has shown that usability is the second most important property of a website.

As an example of poor usability, current frames are a disaster!

Usability of frames [continued]

Currently devising a replacement for Frames.

Device-independence advantage: more navigational possibilities.

Diversion: arachnophobia

"Google is, for all intents, a blind user. A billionaire blind user with tens of millions of friends, all of whom hang on his every word. I suspect Google will have a stronger impact than [laws] in building accessible websites."


"In a world where Google likely has a valuation several orders of magnitude higher than any chrome such as flash, graphics, audio, interactivity, or "personalization", I see a heady revision."

Karsten M. Self

Spider traps

More device independence

Less scripting

No hard-wired presentation


New Forms


Current HTML events are a disaster

Problems include:

XML Events

XML markup binding to DOM2 Events

Extensible for new event types

'Abstract' events can replace the old device-dependent ones (e.g. 'activate' instead of 'click')

Independent of scripting language

Can entwine event markup in document, or can separate it out

Device-independence advantages: more types of events, other types of scripting (e.g. declarative)

<a onClick="...javascript..." ...>


<a ev:event="activate" ev:handler="#myhandler" ...>


HTML forms have proven their worth.

XForms improves this:

Essentially defines two separate parts: the 'real' form (data, datatypes and submission details), and form controls bound to the data.

A language may define its own set of form controls.

XForms 'native' form controls are device-independent, and accessible.

Example Form Control

<input ref="order/shipTo/street">
  <hint>Please enter the number and street name</hint>

A user agent has a default presentation.

If the user agent supports it, a stylesheet can be used to define other presentations.

Another example control

<select ref="my:icecream/my:flavors">

This example covers both radio-button style selection, and menu selection: not encoded in the control.


HTML was originally designed as a structure description language, not a presentational language.

The design of XHTML is truly 'radical': taking HTML back to its roots.

Device independence and accessibility are surprisingly closely related (as are accessibility and usability)

Even though website builders may not yet know it, device independence, accessibility and usability have a major economic argument in their favour.