Home arrow XML arrow Page 3 - XForms Basics

... In With the New - XML

XMLToday, XML is most definitely in the mainstream, and proving its mettle by making all kinds of new and unique applications possible (witness the success of Amazon.com's AWS service, or the Google APIs, both based on XML technology). This article provides an introduction to XForms, a recent W3C Recommendation that suggests using XML to manage the display, input and processing of form data on the Web.

  1. XForms Basics
  2. Out with the Old...
  3. ... In With the New
  4. What's In A Name?
  5. Welcome to Nowhere
  6. A Tour of Nowhere
By: Harish Kamath, (c) Melonfire
Rating: starstarstarstarstar / 41
January 12, 2004

print this article



XForms was designed to address these drawbacks, and also breathe fresh life into traditional approaches to handling user input in a client-server paradigm.

If you take a look at the requirements document for XForms - it's available online at http://www.w3.org/TR/xhtml-forms-req - you'll see that XForms was designed to enable the "separation of the data being collected from the markup of the controls collecting the individual values." Right at the outset then, the XForms specification makes a clear distinction between the form model (what the form does) and its controls (what it looks like).

A simple example of this might be a form which asks for your gender. In a Web browser, you'd be presented with radio buttons or a drop-down list, while on a cell phone, you'd be asked to enter a particular number corresponding to the choices. This distinction between form (no pun intended) and function makes it possible to use a single form model on multiple platforms and devices, by defining what the form is supposed to do once, and then further defining the user interface for each device or platform to be supported separately.

XForms also come with built-in data typing capabilities and event handlers, making it possible to validate user input without having to resort to complex scripting or server-side business logic. XForms can even be integrated with the validation rules laid down in XML Schemas, to further centralize application logic and reduce the impact of changes in business rules.

Another good thing about XForms, especially as we move to a more XML-centric world, is its native support for the XML standard. Data entered into an XForm is usually submitted to the receiving application in XML format. This simplifies integration with third-party tools (which are gradually becoming XML-aware) and also reduces the need for complex data processing and manipulation routines, as the submitted data can easily be parsed using standard SAX or DOM interfaces.

There's only one problem. While the theory is certainly exciting, practical implementation still leaves a lot to be desired. The W3C's XForms site at http://www.w3.org/MarkUp/Forms/ lists a number of different XForms implementations, but the technology has yet to make an appearance in any popular browser; this makes it harder to test and research.

Of the different implementations available, the examples in this tutorial were tested with FormsPlayer (http://www.formsplayer.com/), though you will also get good results with X-Smiles, a Java browser (http://www.x-smiles.org/) and Novell's XForms (http://www.novell.com/xforms). Expect to spend some time with the documentation for each of these implementations to get your XForms development environment up and running. (Tip: I found FormsPlayer to be the simplest to install, as it integrates directly with Internet Explorer 6.0)

>>> More XML Articles          >>> More By Harish Kamath, (c) Melonfire

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Google Docs and Xpath Data Functions
- Flex Array Collection Sort and Filtering
- The Flex Tree Control
- Flex List Controls
- Working with Flex and Datagrids
- How to Set Up Podcasting and Vodcasting
- Creating an RSS Reader Application
- Building an RSS File
- An Introduction to XUL Part 6
- An Introduction to XUL Part 5
- An Introduction to XUL Part 4
- An Introduction to XUL Part 3
- An Introduction to XUL Part 2
- An Introduction to XUL Part 1
- XML Matters: Practical XML Data Design and M...

Developer Shed Affiliates


Dev Shed Tutorial Topics: