Xforms Tutorial

Release 2.0 - ...


XForms is a World Wide Web Consortium recommendation for creating web forms and web applications. You can learn XForms pretty easily. Webforms  created with XForms, provide a rich user experience, and you do not need to learn JavaScript, jQuery or HTML 5 to implement snappy forms. XForms is a comprehensive, consistent development platform based on the MVC (Model View Control) pattern.

It comes with built-in validation, support for multi-step forms (Wizards), repeating structures, a complete submission module (HTTP, Web Services, REST, and more), all using pure, fully self-contained, declarative XML.

Despite discussions about client-side vs server-side Xforms implementations, it is a fact that renowned companies like IBM, Orbeon, BetterForms and Seneca have embraced XForms as a server-technology, and it is not without reason that server-side implementations are now emerging.

Our Xforms implementation is based on the Microsoft .NET development platform. It is independent of Smartsite technology and can be used within other .NET environments, such as ASP.NET and ASP.NET MVC.

What's in the tutorial

This tutorial is an introduction and a best practice workbook for both beginning and advanced users. The tutorial is divided in three parts.

  • The first part is : Getting started with Xforms, giving you a head start;
  • The second part goes more deeply into complex Xforms examples. It is meant for the experienced user;
  • The third part zooms into the integration with the Smartsite CMS platform. It is meant for SXML developers;


The tutorial is based on several sources about Xforms.
Main contributors are:

Some background

The XForms standard arose from the impossibility of HTML to manage complex forms. HTML Forms mingles form data, form presentation and application logic.  Such a mix complicates creating and managing forms. The XForms standard uses the MVC (Model View Control) pattern.  In short, MVC separates Model (Data and Application Logic), View (Presentation) and Control (handles communication between Model and View e.g. GET and POST requests).

Advantages of XForms

  • Web Standard, XForms is a W3C standard and allows web applications to be created without lock in to any specific vendor+
  • Consistency with Other Standards, XForms was designed to be consistent with other web standards such as CSS, XML Schema and XPath. If you know CSS then you can quickly learn how to style your XForms+
  • Declarative, XForms is a declarative system. It allows users to declare what they want the forms to do, not how to do it. This gives non/programmers access to the forms development process;
  • No need for JavaScript, XForms minimizes hard-to-maintain, difficult to debug and potentially insecure JavaScript;
  • Clean and consistent use of MVC architecture;
  • Forms are easier to create, debug and maintain;
  • Forms have clear Separation of Concerns, meaning all your forms can share a common style sheet, model, bindings and presentation.
  • Extensibility of XForms (write your own custom controls);