Does XForms need to be implemented natively in browsers?


For as far as we can remember, we've been getting variants of the following question: "Does XForms, as a technology, really have a future? I wonder, as I don't see browsers making any moves to implement it."

When considering technologies, it is reasonable to worry about their future. But why would one think XForms has no future if it isn't implemented in browsers?

In the late 90s and early 2000s, XML technologies were widely imagined to be the foundation on which future web apps would rely. As part of that vision, browser vendors implemented XML parsing, XPath, XSLT transformations, and even CSS styling of XML documents. XForms too was initially designed to nicely fit in that stack.

For better or for worse, that XML-centric vision didn't come to fruition. This in particular means that initial efforts to bring XForms to the browser natively have been abandoned. Instead today's browsers mostly eschew XML and implement improved, faster and more robust versions of the technology stack we had 10 years ago: HTML, CSS, the DOM and other JavaScript APIs, and of course JavaScript itself.

In short, in the browser, JavaScript has won and XML has lost, as part of the native browser stack. It might be disappointing to some, but at Orbeon, we recognized this many years ago. In 2005 already we implemented the first version of our Ajax-based XForms engine, which shipped in Orbeon PresentationServer 3.0.

So the native XForms ship has sailed a long time ago in our opinion. Instead, the web browser has increasingly shown to be a great platform to build all sorts of application and frameworks, and XForms happens to be just one such technology.

This situation in fact has great benefits: nobody waits for browser vendors or all web users to upgrade their browsers to use a newer version of jQuery or Ruby on Rails. So not being a native browser technology allows us to move faster, and you to benefit from improvements sooner (proof: the Orbeon Forms engine still works in IE 6!). It also allows Orbeon to implement a split architecture, where data can reside on the server, while logic run on either the browser or the server, depending on what is the most appropriate.

And what about HTML5 forms? Do HTML5 forms mean that XForms is no longer needed? HTML5 contains welcome incremental improvements over what is available in HTML 4: if you are creating very simple forms, HTML forms and a bit of JavaScript will be just fine. Where XForms has a big edge is for creating complex forms, maybe with sophisticated validation logic, or to manage a large number of forms. And needless to say, if you already deal with XML data, XForms will be a perfect match.