Why XForms Matter, Revisited

by Kurt Cagle

A profound change is likely about to shake up your world if you're a web developer, one that I suspect will make the recent efforts in the AJAX space pale in comparison as far as its effect. Very quietly, over the last few weeks, the Mozilla team has been upgrading their XForms capabilities through the use of an XForms extension. It requires that you are running Firefox 1.5.0.1 or above, or Seamonkey 1.0 or above, but frankly, there are very few reasons for you not to be at this stage if you're a Firefox or Seamonkey fan.

More than two years ago, I wrote a piece in my blog with the name "Why XForms Matter" that examined this technology in some detail, but at the time, the level of support for XForms was rather depressingly thin. A standard formalized in 2003, the XForms 1.0 Recommendation offered up an intriguing vision - an XML based format for the deployment of form fields both within XHTML documents and within other XML environments (such as SVG, the Scalable Vector Graphics language) that would make it possible to make a surprisingly powerful rich client that didn't have to be extraordinarily heavy in terms of memory footprint, processing power, or speed. What's more, as a W3C standard, it could be deployed with no royalty costs, could be implemented on a wide variety of platforms in implementations that only had to be compliant to the standards, not to any development language, and couldn't be held hostage to a company's need to change their operating environment every time sales figures lagged for the quarter.

32 Comments

fghjvhj
2006-03-20 06:54:14
fghjfghjfhj
er
2006-03-20 14:47:23
Please don't take this the wrong way. I simply don't understand XForms. Sure I have negative opinions of XML, but setting those aside, is XFroms as replacement for HTML forms:



I also don't understand its relationship to AJAX. Can XForms handle asynchronous retrival of data?
Erik Bruchez
2006-03-20 16:58:04
Kurt, great article! But while client-side XForms implementations have their place, you cannot propose the XForms programming model as a practical alternative to the low-level Ajax programming model without looking at how it is possible to forego native client implementations such as Firefox or plugins such as FormsPlayer. It would be only fair if you looked at Ajax-based XForms implementation such as the open source Orbeon PresentationServer (http://www.orbeon.com/).
Kurt Cagle
2006-03-20 17:14:19
Erik,


I don't necessarily see AJAX as an alternative to XForms. Rather, I see AJAX as being a step towards XForms - as Orbeon (which is a wonderful technology, btw) illustrates, you can create a very effective XForms technology around AJAX. Indeed, while I haven't looked at the source yet on it, I suspect that the low level Mozilla implementation likely is calling AJAX-like code in the background.


XForms is, like most XML technologies, an abstraction layer, not an implementation layer. Whether or not its the best abstraction layer will likely be debated until the cows come home, but for at least one domain - form-like content, it works very well. There are no doubt many places where an AJAX-centric solution that doesn't involve XForms makes sense ... however, given that XForms is vastly underutilized for what it could be doing, it doesn't hurt to at least raise the awareness of the technology a bit

Allan Beaufour
2006-03-21 02:07:14
Nice article!
Robert C. Leif
2006-03-21 04:42:10
Since, apparently at least, the FormsPlayer version of XForms can interact with compiled code, this may be away to use XForms directly with the programming language of one's choice.
mawrya
2006-03-21 10:21:05
Kurt, wonderful to to hear you write of the power in XForms. I have been waiting for something like XForms to catch on since 2000 when I first started studying XML. XML is the rich way to describe document style data, but a massive amount of that data needs to come from user entry. XForms is the tool to get the data from the average Joe user into the desired XML schema efficiently. How wonderful to be able to quickly build intelligent forms to collect structured data in any schema you want (or create) and forward that to the server, or even better, save it on your hard drive and forward it when you are finished/ready.


Expense reports, workplace accident reports, blog entries, calendar appointments, purchase orders, invoices, income tax reports, school tests, contact info, all possible now but XForms makes it all so much cleaner and easier to build and manage.


How wonderful to have a cache of XForms on my laptop that allows me to fill out tax reports, blog entries, expense reports while offline, save to disk, then submit them to the server the next morning at the office!


Kudos to Allan Beaufour and his mates working on the Mozilla extension, hopefully it will be grafted into the main Mozilla code in the near future.


Erik Bruchez
2006-03-21 15:02:41
Kurt, in fact I agree 100% with your statements! I believe there are two main facets to the XForms question today: implementations, and raising the awareness of the XForms technology. In both cases, the Ajax story is relevant.
Mark Birbeck
2006-03-22 02:26:49
Kurt,


Once again a stunning article!


I think the key point that you make--and which is widely missed and unfortunately not very well promoted from within the XForms community--is that XForms is an incredible abstraction layer.


This means two things; first, even if you convert XForms to a combination of HTML and script as Erik describes (I think they call that 'Ajax' nowadays, don't they...;) it is still a lot easier to manage the original XForm than it is to manage script built on an Ajax library. As you say, if you have a way of converting an XForms select1 to HTML+JS and you have a way of converting a switch/case combination to HTML+JS, then you can create tabbed dialog boxes without writing any more HTML+JS...you just combine the widgets in new ways.


And the second thing--which is again something you point out extremely well--is that XForms is a *standard* way to express things. Currently, when using different Ajax libraries, we have any number of different ways of getting notification that our data has been sent, or new data received. However, with XForms, regardless of what platform you run on (Ajax or Java, Firefox or IE) you will always get the "xforms-submit-done" event.


Ajax unfortunately doesn't even seem to have a standard eventing mechanism, never mind standard event names, which means that you can't even use different widgets from different libraries together; imagine the development power that would be unleashed if everyone who is developing widgets for Ajax was developing them in a standard way? Even if they still used script, if we had standard event names (and a standard eventing architecture) and perhaps a standard document structure (perhaps XBL) then all this energy could be reused over and over, and built on in ways that we haven't even begun to think about. This is the possibility that using standards like XForms, XML Events, and so on, holds out.


Still, it's important to get the balance right--the energy and sheer ingenuity that has gone into the Ajax wave has made people open to the ideas expressed by XForms, and if XForms does have any success in the next few years, it will be thanks to this atmosphere of experimentation. It makes this an exciting time for software developement!


Finally, I hope you don't mind, but I'll post a couple of links to articles on my blog that discuss some of these issues, and so may be of interest to readers of your article. One is on the idea of 'patterns' in XForms--XForms as an executable pattern language and is part of a debate I had on the subject of declarative mark-up versus script, with Bill McCoy of Adobe. Another relates to a debate that ran on one of the SVG lists, concerning scripting versus abstracting functionality out into components that are bound in at run-time (again declaratively): Loosely couple objects and declarative programming.


And finally, on why XForms is part of the Ajax family, even if it's most likely to leave home and go on to greater things (perhaps visiting occassionally to do its laundary): XForms and 'Ajax languages'.


Best regards,


Mark



Mark Birbeck
CEO
x-port.net
http://www.formsPlayer.com/

Steven
2006-03-22 04:22:10
Exactly! Great stuff!


A small correction: it is , not .


A couple of stylistic points:


- you can write , since the context is by default the root element of the instance.


- rather than the

, you can use:



Author
...

Steven
2006-03-22 04:25:03
(Sorry, my markup got eaten; try again)


Exactly! Great stuff!


A small correction: it is <select1>, not <selectone>.


A couple of stylistic points:


- you can write <xf:repeat ref="d:author">, since the context is by default the root element of the instance.


- rather than the <fieldset><legend><div>, you can use:


<xf:group>
<xf:label>Author</xf:label>
<xf:input ref="d:firstname">...

Duane Gran
2006-04-06 12:51:44
When you say "the more complex the applications become, the more that they in fact begin to resemble … well, XForms" it really resonates with me. A few years back I designed a dreadfully complex system to edit XML documents via a web interface using Javascript. The cacophony of hard-coded rules and DHTML tricks to repeat and delete elements was mind-boggling. The XForms specification was in review at the time, but I knew my approach was a necessary evil.


Today I'm redesigning the old system with XForms, and while it isn't a walk in the park, I have a degree of confidence that the data model and logic bears resemblance to the data. I also believe XForms can be supported and maintained by another person. Keep up the good articles.

Leigh L. Klotz, Jr
2006-04-09 16:00:44
Great Article! Over the past two years I've been applying the work we did on XForms in my work at Xerox with Intranet applications, and it's been quite beneficial. It's been really great having a field of suppliers vying to provide me with what I need. Firefox is a great addition to this area, and one that I hope will jumpstart XForms adoption on the Internet.
Brendan McKenna
2006-08-31 09:46:20
Nice article. The problem with XForms is that no matter how nice a concept it is, until the majority of browser are distributed with it (and with it enabled) by default, it's really not ready for prime time. Since I have to develop web applications with all potential users in mind, I can't assume that someone's going to have an XForms imlementation in their browser. I mean I still have to support IE5.0 in my applications. It's one thing to be interested in the latest and greates thing to come down the pike, but it's entirely another to be in a position where you can use it for a client's (public-facing) web site. Don't get me wrong, I'd -love- to be able to use XForms. It's just that for the next few years, it's not likely to happen.
cybercow
2006-09-03 11:36:30
This is all great but what we can do if today Xforms aren't yet a full functional cross-browser thing, i wanted to start using them because of great functionality one year ago, but there you have lot of Xforms players jonglery and trickery before you get them work, not to mention incompatibility problems.... so Where Xforms will be alive i want to start using them finally (uh i find me saying same thing years ago)...
[3!]kita66
2007-01-04 21:55:02
Very interesting.
[3!]conos
2007-01-17 11:10:30
great site

2007-02-01 06:34:50
53c04118df hi, i`m from india, and i has been very hart by you site)))
Hdklfjsd
2007-03-27 04:31:12
Fsdfsdd
2007-03-27 23:54:24
Hdklfjsd
2007-03-28 06:34:36
imparare
2007-04-15 02:14:50
Interesting comments.. :D
Nbkvqgl
2007-06-02 20:28:56
Nbkvqgl
2007-06-02 20:28:58
Nbkvqgl
2007-06-02 20:29:02
wfertuy
2007-06-05 08:00:10


The perfect chicken soup recipe
Think big, crisp, and gloriously browned when you want a bird that reigns
supreme at the table Size matters. Position doesn't. That's what a palate-weary ...
Robert
2007-07-27 17:51:04
Managed Hosting, Colocation and Data Center Services by victoryushchenkonashpresudent ...
Son
2008-01-01 17:43:44
The Forms Working Group is comprised of W3C members and invited experts. The Working Group meets weekly by phone. Face to face meetings occur roughly every 3 months and are hosted by member organizations. We are especially interested in people with a rich experience in developing Web forms and supporting tools
Son
Pete
2008-01-14 17:47:19
I took some of your article for translation into dutch. If is for a Dutch learning wiki It is part of a AJAX learning path to master the programming code. Is this ok?
Bruno
2008-02-13 08:18:06
Interesting article. I have put the link on my blog.
ogs
2008-05-11 05:15:11
I also don't understand its relationship to AJAX. Can XForms handle asynchronous retrival of data?
syam
2008-07-26 12:01:52
Hi I am not able to view any of the elements like submit buttons in spite of adding plug-in/add-ons. Please advice
Thanks