Tuesday, January 31, 2006

Understand XForms with the new “DMV Forms” sample application


We just introduced for the first time at the ObjectWeb conference a new XForms example that runs on the Orbeon PresentationServer (OPS) 3.0 platform. The "DMV Forms" sample application shows how to implement dynamic web forms "the right way" with XForms, services and OPS. It is based on a real-life form, namely a California Department of Motor Vehicles form.

Access a live demo of the example within the OPS examples portal or standalone (faster).

The DMV Forms example tackles:

  • Using XForms to capture and display form data. XForms was designed primarily to replace HTML forms, and of course it shines at capturing and displaying form data. We illustrate how to use XForms control to capture simple text data, dates, and flags.

  • Using XML Schema to validate form data. By using XForms's XML Schema support, you can write validation constraints once and use them both on the client and on the server. We also show how you can use other XForms constraints to ensure that certain fields are required.

  • Using XForms to retrieve and save data from XML services. XForms is fully XML-aware, not only in its syntax, but in the way it communicates with the external world. This example retrieves and stores data through XML services thanks to the XForms submission facilities.

  • Repeating homogeneous data sections. In this example we show how you can easily insert new rows and delete existing rows in a repeated section, using xforms:repeat, xforms:insert and xforms:delete, while controlling the minimal and maximal number of rows.

  • Producing forms in formats such as HTML, XML or PDF. Storing form data in XML format makes it easy to exchange between systems. This example allows you to easily look at the resulting XML document. It also features a full template-based PDF export, which allows you to print an official resulting form. The PDF facilities are available in Orbeon PresentationServer.

  • Implementing XML services. Many technologies and platforms can be used to implement services. Orbeon PresentationServer does not focus on services but on the presentation, however, we show how you can quickly implement XML services with OPS's Page Flow Controler, XPL and the eXist XML database,

  • Navigating between pages. XForms pages rarely exist in a vacuum, and are often part of a flow of pages. Here we show how you can easily go back and forth between a summary and detail page while passing information in the process using the OPS Page Flow Controller and XForms facilities such as xforms:load and xforms:submission.

  • Externalizing resources. We show how easy it is to externalize text resources in order to facilitate maintenance and localization.


  1. Well, this is really interesting to see what XForms / Orbeon can offer together (especially xforms:repeat in my case)
    Is there a way to download the whole example files instead of copy/pasting each ?

  2. Thanks Alexandre! Currently there is no easy way to download the source save for downloading an entire build of OPS. We will think about how we can improve that. Even copy/pasting each file is not so great, because you don't have comments and lose some of the original formatting. The easiest way to get the source in the really short term will be to download the upcoming OPS 3.0.1 version.

  3. Good news, I've just downloaded it ! As customizing the app to fill my needs is still a bit 'obscure' to me, do you have any idea of when the tutorial based on DMV will be released ?
    Thanks again.

  4. Alexandre, sorry, no ETA as of yet! Keep watching our blog and mailing-list. I also should mention that the online source viewer has been improved and now supports download of individual files. You can check it out by selecting the "View Source" tab of each example.