XForms for Managing Forms-Based Data
and Java code for managing data entry
by Anthony Tomasic
December 2002 Issue
The World Wide Web Consortium (W3C)'s draft XForms standard defines a set of XML elements that expand vastly the power of data-entry devices, such as browsers, to capture and validate forms-based data. The XForms Working Group has focused on device independence, data validation, and improved internationalization support to give you a new, elegant, and powerful way to code data-entry systems. By centralizing form behavior and data validation into a single location, XForms eliminate the hassle of browser scripting, the associated quagmire of multiple browser-language versions, and the mind-numbing coding of data-validation checks.
You can leverage your knowledge of the existing W3C standards XForms builds on XML, XHTML, Cascading Style Sheets (CSS), XML Schema, XPath, and XML eventsfor a lower XForms learning curve. XForms' features help you spend more time on creative, application-specific work and less time on routine infrastructure.
An XForms-based implementation of the same system consists of three parts. The first is a set of XForms documents the Web designers and developers write. The second is a shared XML schema data model a developer or XML administrator defines. The third partan XForms standard engineinterprets the XForms documents and XML schema.
Each XForms document handles all four aspects of the traditional implementation. The documents reference the shared XML schema, designed explicitly for data entry, that provides explicit support for data validation. A user browser generates an HTTP request for an XForms document; the XForms engine manages the interaction with the user according to the rules defined in the XForms document; the XForms engine validates data entry; and valid data-entry results are delivered to the server as XML documents, ready for the next step in processing. This system requires far less time and labor to construct than the traditional implementation, and it's easier to modify.
Fill Out the Form
In our example, users access a form both to sign up multiple participants in a workshop and conference and to provide additional information such as the participants' company addresses. The full XForms document describes the form. For this discussion I've stripped out most of the HTML style information to concentrate on the XForms material. Both of these listings conform to the January 18, 2002 draft XForms 1.0 standard. (Although the standard is relatively stable, you should expect some changes before the final version arrives.)
Back to top