XForms
Encyclopedia
XForms is an XML
XML
Extensible Markup Language is a set of rules for encoding documents in machine-readable form. It is defined in the XML 1.0 Specification produced by the W3C, and several other related specifications, all gratis open standards....

 format for the specification of a data processing model for XML data and user interface
User interface
The user interface, in the industrial design field of human–machine interaction, is the space where interaction between humans and machines occurs. The goal of interaction between a human and a machine at the user interface is effective operation and control of the machine, and feedback from the...

(s) for the XML data, such as web forms
Form (web)
A webform on a web page allows a user to enter data that is sent to a server for processing. Webforms resemble paper or database forms because internet users fill out the forms using checkboxes, radio buttons, or text fields...

. XForms was designed to be the next generation of HTML
HTML
HyperText Markup Language is the predominant markup language for web pages. HTML elements are the basic building-blocks of webpages....

 / XHTML
XHTML
XHTML is a family of XML markup languages that mirror or extend versions of the widely-used Hypertext Markup Language , the language in which web pages are written....

 forms, but is generic enough that it can also be used in a standalone manner or with presentation languages other than XHTML to describe a user interface and a set of common data
Data
The term data refers to qualitative or quantitative attributes of a variable or set of variables. Data are typically the results of measurements and can be the basis of graphs, images, or observations of a set of variables. Data are often viewed as the lowest level of abstraction from which...

 manipulation tasks.

XForms 1.0 (Third Edition) was published on 29 October 2007. The original XForms specification became an official W3C Recommendation
W3C recommendation
A W3C Recommendation is the final stage of a ratification process of the World Wide Web Consortium working group concerning a technical standard. This designation signifies that a document has been subjected to a public and W3C-member organization's review. It aims to standardise the Web technology...

 on 14 October 2003, while XForms 1.1, which introduced a number of improvements, reached the same status on 20 October 2009.

Differences from HTML forms

In contrast to the original HTML forms, the creators of XForms have used a model–view–controller approach. The model consists of one or more XForms models describing form data, constraints upon that data, and submissions. The view describes what controls appear in the form, how they are grouped together, and what data they are bound to. CSS
Cascading Style Sheets
Cascading Style Sheets is a style sheet language used to describe the presentation semantics of a document written in a markup language...

 can be used to describe a form's appearance.

An XForms document can be as simple as an HTML form (by only specifying the submission element in the model section, and placing the controls in the body), but XForms includes many advanced features. For example, new data can be requested and used to update the form while it is running, much like using XmlHttpRequest
XMLHttpRequest
XMLHttpRequest is an API available in web browser scripting languages such as JavaScript. It is used to send HTTP or HTTPS requests directly to a web server and load the server response data directly back into the script. The data might be received from the server as XML text or as plain text...

/AJAX
Ajax
- Mythology :* Ajax , son of Telamon, ruler of Salamis and a hero in the Trojan War, also known as "Ajax the Great"* Ajax the Lesser, son of Oileus, ruler of Locris and the leader of the Locrian contingent during the Trojan War.- People :...

 except without scripting. The form author can validate user data against XML Schema data types, require certain data, disable input controls or change sections of the form depending on circumstances, enforce particular relationships between data, input variable length arrays of data, output calculated values derived from form data, prefill entries using an XML document, respond to actions in real time (versus at submission time), and modify the style of each control depending on the device they are displayed on (browser versus mobile versus text only, etc.). There is often no need for any scripting with languages such as JavaScript.

Like HTML forms, XForms can use various non-XML submission protocols (multipart/form-data, application/x-www-form-urlencoded), but a new feature is that XForms can send data to a server in XML format. XML documents can also be used to prefill data in the form. Because XML is a standard, many tools exist that can parse and modify data upon submission, unlike the case with legacy forms where in general the data needs to be parsed and manipulated on a case by case basis. XForms is itself an XML dialect, and therefore can create and be created from other XML documents using XSLT
XSL Transformations
XSLT is a declarative, XML-based language used for the transformation of XML documents. The original document is not changed; rather, a new document is created based on the content of an existing one. The new document may be serialized by the processor in standard XML syntax or in another format,...

. Using transformations, XForms can be automatically created from XML Schema
XML Schema
XML Schema, published as a W3C recommendation in May 2001, is one of several XML schema languages. It was the first separate schema language for XML to achieve Recommendation status by the W3C...

s, and XForms can be converted to XHTML forms. XForms can only be used on the server side as they are not supported by current browsers.

Software support

At the time of this writing, no widely used web browser
Web browser
A web browser is a software application for retrieving, presenting, and traversing information resources on the World Wide Web. An information resource is identified by a Uniform Resource Identifier and may be a web page, image, video, or other piece of content...

 supports XForms natively. However, various browser plugins and client-side extensions exist. The following lists some implementations:
  • The Firefox
    Mozilla Firefox
    Mozilla Firefox is a free and open source web browser descended from the Mozilla Application Suite and managed by Mozilla Corporation. , Firefox is the second most widely used browser, with approximately 25% of worldwide usage share of web browsers...

     XForms extension is part of the Mozilla Project, is compatible with releases of Firefox and Mozilla, and is built with nightly builds on most platforms as well as of version 0.8.4 (February 6, 2008). Full XForms 1.0 SE support is not complete but covers most of the specification with a notable exception of attribute-based repeating used in HTML tables. The extension is available for both Firefox 2 and Firefox 3, but will not be upgraded to support Firefox 4 and higher (Lead developer blog ).
  • IBM Lotus Forms
    IBM Lotus Forms
    IBM Forms is a suite of products by IBM's Lotus Software division that interact to develop and deliver data-driven, XML-based electronic forms to end-users. IBM Forms consists of a server, designer, and client viewer that enable creation, deployment, and streamlining of forms-based processes...

     supports development and deployment of XForms-based pure XML forms. Trial downloads are available of an Eclipse-based visual design environment and a client-side viewer that can run XForms-based forms both in the web browser and as a standalone desktop application.
  • OpenOffice.org
    OpenOffice.org
    OpenOffice.org, commonly known as OOo or OpenOffice, is an open-source application suite whose main components are for word processing, spreadsheets, presentations, graphics, and databases. OpenOffice is available for a number of different computer operating systems, is distributed as free software...

     versions 2.0 and greater support XForms.
  • AgenceXML XSLTForms and Ubiquity XForms are two implementations which run in most popular desktop browsers, and are largely, though transparently, implemented in JavaScript
    JavaScript
    JavaScript is a prototype-based scripting language that is dynamic, weakly typed and has first-class functions. It is a multi-paradigm language, supporting object-oriented, imperative, and functional programming styles....

    .
  • Orbeon and betterFORM are two server-side implementations in Java, both of which work with popular desktop browsers, and can work with or without Javascript browser support.

Implementation technologies compared

FormFaces, AJAXForms, XSLTForms, betterFORM, Chiba and Orbeon Forms are based on Ajax technology
Ajax (programming)
Ajax is a group of interrelated web development methods used on the client-side to create asynchronous web applications...

. The amount of server-side and client-side processing varies between these implementations. For example, Ubiquity XForms, FormFaces and XSLTForms provide 100% XForms client-side processing and data model updates via pure Ajax processing on the XForms standard. The others use server-side Java XForms processing transcoding to Ajax markup prior to delivering the content to the browser. Both techniques can work across browsers. Each implementation is significantly different with respect to dependencies, scalability, performance, licensing, maturity, network traffic, offline capability, and cross browser compatibility. System architects should evaluate these constraints against their need to determine potential risks and objectives.

Plugins like FormsPlayer and other client-side technology can have some benefits as well: because they integrate themselves into the browser, they will work with existing server architectures, can be more responsive, and require fewer server fetches. They can also present themselves in more user-friendly ways (i.e. controls that do not already exist in the browser, like sliding scales, can be added to a page), although the advent of JavaScript widgets is currently offsetting that benefit.

The tradeoff between server-side and client plug-in solutions is where the software is maintained; either each client must install the required plug-in, or the server architecture must change to accommodate the XForms transcoder engine language technology. It is in theory possible to mix both of these solutions, for instance testing the browser for a client-side XForms implementation and serving native XForms in that case, and defaulting to a server solution in other cases.

Ubiquity XForms, FormFaces and XSLTForms provide a "zero software" solution on either the client or server: no new software needs to be installed on the client and the solution can be used in conjunction with any server-side architecture. This is possible because FormFaces and Ubiquity XForms are written 100% in Ajax and because XSLTForms is written in XSLT and in Ajax. The tradeoff is that compared to other solutions, more code is initially downloaded to the client (code can be cached on the client), and FormFaces does not yet support XML Schema validation. Furthermore, XForms submissions with replace "all" behaviour will typically not result in true page replacements and therefore break the normal back button behaviour.

XRX application architecture

Because XForms makes it easy to edit complex XML data there are many advantages to using XForms with native XML databases that frequently leverage REST
Representational State Transfer
Representational state transfer is a style of software architecture for distributed hypermedia systems such as the World Wide Web. The term representational state transfer was introduced and defined in 2000 by Roy Fielding in his doctoral dissertation...

 interfaces. The combination of three technologies (XForms on the client, REST interfaces and XQuery
XQuery
- Features :XQuery provides the means to extract and manipulate data from XML documents or any data source that can be viewed as XML, such as relational databases or office documents....

 on the server) is collectively known as XRX
XRX (web application architecture)
In software development XRX is a web application architecture based on XForms, REST and XQuery. XRX applications store data on both the web client and on the web server in XML format and do not require a translation between data formats...

 application development. XRX is known for its simple architecture that uses XML both on the client and in the database and avoids the transformations to object or relational data structures. See "XRX:Simple, Elegant, Disruptive".

Benefits

XForms provides specific benefits when used on mobile devices:
  • User interfaces using XForms require fewer round trips with the server and are in that sense more self contained than user interfaces using HTML 4 forms.
  • Capabilities of mobile devices vary greatly; consequently the amount of the work involved in generating different user interfaces for different devices is of particular concern in the mobile world. XForms has been designed from the ground up to allow forms to be described independently of the device, which reduces the amount of work required to target multiple devices.
  • XForms reduces the need for JavaScript, which is particularly interesting as JavaScript support varies greatly on mobile devices and cannot be widely relied upon. This also allows systems on which JavaScript is disabled for security concerns to continue to operate flawlessly.

Xfolite

Xfolite is a light-weight XForms client for the J2ME platform. It was originally created at Nokia Research Center, and it includes a DOM and XPath 1.0 implementation as well as an XForms engine that implements the XForms 1.1 specification almost completely. XFolite is currently in beta and should not be considered ready for production use. The first real world implementation has been in the Nokia Data Gathering mobile client . XML Schemas and CSS are outside project scope, however. Xfolite is open source and licensed under the LGPL license.

JavaRosa

JavaRosa is an XForms client written in Java Mobile Edition (J2ME), and supports a wide array of devices, from top-end smart phones and PDAs with large screens and abundant memory, to low-end devices like the Nokia 6085 and 2630. Making JavaRosa usable on low-resource devices is one of the project's highest priorities. JavaRosa 1.0 Alpha was released in September 2010.

ODKCollect

ODKCollect is part of the Open Data Kit, and is an XForms client for Android devices. The client displays XForm in sequential order obeying form logic, entry constraints, and repeating sub-structures. Users work through the prompts and save the submission as completed or partially completed (allowing later revision), and can record pictures as well as their location using the phone's built-in camera and GPS device, respectively.

Group Complete

Group Complete is a mobile data collection system that includes Group Complete Mobile (GC Mobile), an XForms client for Android devices. GC Mobile provides an interface to create XForms on the mobile device as well as XForms data entry with capabilities similar to ODKCollect. Forms and data are stored in CouchDB databases allowing mobile workers to make changes to forms and data while offline, collaborate on data entry and share collected data with team members and backoffice data consumers in real-time. Group Complete is compatible with all major ODK systems.

External links


The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK