XForms

Last updated

XForms is an XML format used for collecting inputs from web forms. XForms was designed to be the next generation of HTML / XHTML 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 manipulation tasks.

Contents

XForms 1.0 (Third Edition) was published on 29 October 2007. The original XForms specification became an official W3C Recommendation on 14 October 2003, while XForms 1.1, which introduced a number of improvements, reached the same status on 20 October 2009.

Differences from web forms

In contrast to the original web forms (originally defined in HTML), the creators of XForms have used a model–view–controller (MVC) 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 can be used to describe a form's appearance.

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 (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. Similar tools for legacy forms also exist. XForms is itself an XML dialect, and therefore can create and be created from other XML documents using XSLT. Using transformations, XForms can be automatically created from XML schemas, and XForms can be converted to XHTML forms.

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:

Implementation technologies compared

FormFaces, AJAXForms, XSLTForms, betterFORM, Chiba, Orbeon and Smartsite Forms are based on Ajax technology. 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/.NET 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 needs 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.

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 interfaces. The combination of three technologies (XForms on the client, REST interfaces and XQuery on the server) is collectively known as XRX 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".

XForms for mobile devices

Benefits

XForms provides specific benefits when used on mobile devices:

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

Related Research Articles

<span class="mw-page-title-main">Document Object Model</span> Convention for representing and interacting with objects in HTML, XHTML, and XML documents

The Document Object Model (DOM) is a cross-platform and language-independent interface that treats an HTML or XML document as a tree structure wherein each node is an object representing a part of the document. The DOM represents a document with a logical tree. Each branch of the tree ends in a node, and each node contains objects. DOM methods allow programmatic access to the tree; with them one can change the structure, style or content of a document. Nodes can have event handlers attached to them. Once an event is triggered, the event handlers get executed.

<span class="mw-page-title-main">JavaScript</span> High-level programming language

JavaScript, often abbreviated as JS, is a programming language that is one of the core technologies of the World Wide Web, alongside HTML and CSS. As of 2023, 98.7% of websites use JavaScript on the client side for webpage behavior, often incorporating third-party libraries. All major web browsers have a dedicated JavaScript engine to execute the code on users' devices.

Scalable Vector Graphics (SVG) is an XML-based vector image format for defining two-dimensional graphics, having support for interactivity and animation. The SVG specification is an open standard developed by the World Wide Web Consortium since 1999.

<span class="mw-page-title-main">Web application</span> Application that uses a web browser as a client

A web application is application software that is accessed using a web browser. Web applications are delivered on the World Wide Web to users with an active network connection.

<span class="mw-page-title-main">Mobile browser</span> Web browser designed for use on mobile devices

A mobile browser is a web browser designed for use on a mobile device such as a mobile phone or PDA. Mobile browsers are optimized to display Web content most effectively on small screens on portable devices. Mobile browser software must be small and efficient to accommodate the low memory capacity and low-bandwidth of wireless handheld devices. Traditional smaller feature phones use stripped-down mobile web browsers; however, most current smartphones have full-fledged browsers that can handle the latest web technologies, such as CSS 3, JavaScript, and Ajax.

A user interface markup language is a markup language that renders and describes graphical user interfaces and controls. Many of these markup languages are dialects of XML and are dependent upon a pre-existing scripting language engine, usually a JavaScript engine, for rendering of controls and extra scriptability.

Ajax is a set of web development techniques that uses various web technologies on the client-side to create asynchronous web applications. With Ajax, web applications can send and retrieve data from a server asynchronously without interfering with the display and behaviour of the existing page. By decoupling the data interchange layer from the presentation layer, Ajax allows web pages and, by extension, web applications, to change content dynamically without the need to reload the entire page. In practice, modern implementations commonly utilize JSON instead of XML.

<span class="mw-page-title-main">Dynamic web page</span> Type of web page

A dynamic web page is a web page constructed at runtime, as opposed to a static web page, delivered as it is stored. A server-side dynamic web page is a web page whose construction is controlled by an application server processing server-side scripts. In server-side scripting, parameters determine how the assembly of every new web page proceeds, and including the setting up of more client-side processing. A client-side dynamic web page processes the web page using JavaScript running in the browser as it loads. JavaScript can interact with the page via Document Object Model (DOM), to query page state and modify it. Even though a web page can be dynamic on the client-side, it can still be hosted on a static hosting service such as GitHub Pages or Amazon S3 as long as there is not any server-side code included.

In computer hypertext, a URI fragment is a string of characters that refers to a resource that is subordinate to another, primary resource. The primary resource is identified by a Uniform Resource Identifier (URI), and the fragment identifier points to the subordinate resource.

A webform, web form or HTML form on a web page allows a user to enter data that is sent to a server for processing. Forms can resemble paper or database forms because web users fill out the forms using checkboxes, radio buttons, or text fields. For example, forms can be used to enter shipping or credit card data to order a product, or can be used to retrieve search results from a search engine.

qooxdoo Open-source Ajax web application framework

qooxdoo is an open-source Ajax web application framework. It is an LGPL- and/or EPL-licensed client-side and server-agnostic solution, and includes support for professional JavaScript development, a graphical user interface (GUI) toolkit and high-level client-server communication.

A single-page application (SPA) is a web application or website that interacts with the user by dynamically rewriting the current web page with new data from the web server, instead of the default method of a web browser loading entire new pages. The goal is faster transitions that make the website feel more like a native app.

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. XRX is considered a simple and elegant application architecture due to the minimal number of translations needed to transport data between client and server systems. The XRX architecture is also tightly coupled to W3C standards to ensure XRX applications will be robust in the future. Because XRX applications leverage modern declarative languages on the client and functional languages on the server they are designed to empower non-developers who are not familiar with traditional imperative languages such as JavaScript, Java or .Net.

ZK is an open-source Ajax Web application framework, written in Java, that enables creation of graphical user interfaces for Web applications with little required programming knowledge.

The W3C Geolocation API is an effort by the World Wide Web Consortium (W3C) to standardize an interface to retrieve the geographical location information for a client-side device. It defines a set of objects, ECMAScript standard compliant, that executing in the client application give the client's device location through the consulting of Location Information Servers, which are transparent for the application programming interface (API). The most common sources of location information are IP address, Wi-Fi and Bluetooth MAC address, radio-frequency identification (RFID), Wi-Fi connection location, or device Global Positioning System (GPS) and GSM/CDMA cell IDs. The location is returned with a given accuracy depending on the best location information source available.

Cross-origin resource sharing (CORS) is a mechanism that allows restricted resources on a web page to be accessed from another domain outside the domain from which the first resource was served.

HTML5 Audio is a subject of the HTML5 specification, incorporating audio input, playback, and synthesis, as well as, in the browser. iOS

References

  1. Pemberton, Steven (June 2014). "Live XML Data". XML London 2014: 96–102. doi: 10.14337/XMLLondon14.Pemberton01 . ISBN   978-0-9926471-1-7.
  2. Mozilla: Mozilla XForms Project - Download. Accessed 2013-03-12.
  3. Philipp Wagner: The Future of Mozilla XForms, 13 July 2011
  4. Mozilla Developer Network (MDN): XForms. Accessed 2013-03-12.
  5. Apache OpenOffice: . Accessed 2020-05-24.
  6. The Document Foundation: XML Form Documents (XForms). Accessed 2013-03-12.
  7. "ODK - Collect data anywhere". getodk.org.
  8. "ODK XForms Specification".