The author

Declarative Device-independent User Interfaces: XForms

Steven Pemberton, CWI and W3C, Amsterdam


Markup for applications

Declarative: not how, but what

Turing complete

Separation of data and control: model+view

Intent-based controls



Implementation neutral: native, client-side, server-side, network based

Widely Used

Dutch National Weather Service


Xerox copiers




Petrol Pumps


The Bottom Line

Experience with projects defined with XForms has shown:

Around a ten-times saving in costs, compared with traditional methods.

The Model

Data: Local or remote instances, both source and destination

Devices can communicate by sharing instances.

Properties bound locally to data:


Controls are intent-based rather than presentation oriented:

Rather than specifying that a control consists of radio buttons, or a menu, XForms specifies what the control does, for instance that it selects one item from a list of items. CSS or similar can be used to provide the necessary presentation.

This approach allows the same XForm to be used across different devices without change.

The labels may be populated from local or external sources (good for localisation and multi-lingual environments)

Intent-based Controls

Here are three identical controls, just styled differently:

<select1 ref="sex" label="gender">
  <item label="Male" value="M"/>
  <item label="Female" value="F"/>



The labels and values can be initialised from external files. So adding a new language to a form is just a case of adding the labels for that language to the external file. You don't have to change the form.

<select1 ref="lang"


Controls adapt

Here are two identical controls. The first is bound to a value without any type information. The second has been bound to a value with a type:


Same app, different devices




Instant messenger


Server-side implementations can sniff the device, and serve a tailored version.


Native (eg OpenOffice)

Client-side (eg XSLTForms)

Server-side (eg Orbeon, BetterForms)

Many Enterprise implementations: many companies use XForms either internally or externally, and have their own implementations, either for internal use or for licensing. For instance:

A Final Example


XForms resources

A tutorial:

For an overview of all features, elements and attributes of XForms 1.1, see the XForms 1.1 Quick Reference.

It's not easy reading, but the final arbiter in questions of doubt is the XForms 1.1 Specification.

Living XForms 2.0 Draft:

The implementation used for the examples in this talk is XSLTForms.