XForms
XForms is an
XForms 1.0 (Third Edition) was published on 29 October 2007. The original XForms specification became an official
Differences from web forms
In contrast to the original web forms (originally defined in HTML), the creators of XForms have used a
An XForms document can be as simple as a web 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/AJAX 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 (desktop browser versus mobile versus text only, etc.). There is often no need for any scripting with languages such as JavaScript. However, XForms does include an event model and actions for implementing more complex form behaviors.[1] Actions and event handling are specified using the XForms XML dialect rather than more common scripting languages like JavaScript.
Like web forms, XForms can use various non-XML submission protocols (
Software support
At the time of this writing, no widely used web browser supports XForms natively. However, various browser plugins, client-side extensions and server/client solutions exist. The following lists some implementations:
- The Firefox XForms extension was part of the Mozilla Project.[2] 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 was available for both Firefox 2 and Firefox 3, but is not upgraded to support Firefox 4 and higher. In July 2011 the lead developer wrote that XForms support would no longer get updated.[3] Support for XForms was eventually deprecated in Firefox 19.[4]
- IBM Lotus Forms 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 versions 2.0 and greater and LibreOffice support XForms.[5][6]
Implementation technologies compared
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.
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
XForms for mobile devices
Parts of this article (those related to Benefits) need to be updated. The reason given is: "JavaScript support varies greatly on mobile devices and cannot be widely relied upon." - this was written in 2005 and is outdated.(July 2021) |
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.
Implementations
ODK
ODK[7] is an open-source mobile data collection platform that uses a subset of W3C XForms 1.0 called ODK XForms.[8] ODK provides ODK XForms processing libraries in Java (JavaRosa) and JavaScript (enketo-core).
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 was released as beta software and should not be considered ready for production use as such. However, it does contain a mature XForms engine that has been designed to work with different UI implementations. XML Schemas and CSS are outside project scope, however. Xfolite is open source and licensed under the LGPL license, but is not being actively developed further.
See also
- InfoPath Forms Services
- FormFaces
References
- ISBN 978-0-9926471-1-7.
- ^ Mozilla: Mozilla XForms Project - Download. Accessed 2013-03-12.
- ^ Philipp Wagner: The Future of Mozilla XForms, 13 July 2011
- ^ Mozilla Developer Network (MDN): XForms. Accessed 2013-03-12.
- ^ Apache OpenOffice: [1]. Accessed 2020-05-24.
- ^ The Document Foundation: XML Form Documents (XForms). Accessed 2013-03-12.
- ^ "ODK - Collect data anywhere". getodk.org.
- ^ "ODK XForms Specification".
- XForms 1.1 - W3C Recommendation 20 October 2009.
- Raman, T.V. (2004). XForms: XML Powered Web Forms. Boston: ISBN 0-321-15499-1.
- Dubinko, Micah (2003). XForms Essentials. Sebastopol, CA; Farnham: ISBN 0-596-00369-2. Archived from the originalon 2008-09-15. Retrieved 2005-04-24.
External links
- XForms Resources at W3C
- The XForms Users Community Group
- XForms 1.0 Frequently Asked Questions
- XForms 1.1 was a W3C Recommendation on 20 October 2009
- XForms 2.0 Working Draft
- XForms 2.0: XPath Expressions Module
- A quick introduction to XForms for HTML Authors by Steven Pemberton
- XForms 1.1 Quick Reference
- XForms Implementations
- The Forms Working Group (historical interest)
- XForms 1.0 (Third Edition) was a W3C Recommendation on 29 October 2007
- XSLTForms
- Smartsite XForms