Another example of XForms

[9 January 2012]

In recent years I’ve spent a fair amount of time telling people about XForms as a method for making special-purpose XML editors. From time to time people ask me what sorts of things it’s possible to do in XForms, and by implication what sorts of things don’t fit very well in XForms. It’s a good question, but I don’t know a good way to answer in words. The only way I know to answer is to show some examples of things done in XForms.

In that connection, perhaps it’s worth while to point to an XForms application I put together last year for Balisage 2011. The organizers of Balisage place great weight on feedback from participants, and we’ve always used paper feedback forms distributed to participants on the last day of the conference. Paper forms have the drawback of only being in one place at any given time, and since the organizers don’t all work in the same location, most of the organizers only got a chance to look at the feedback forms on the afternoon after the conference ended, before everyone went home. (Yes, we could have had them photocopied, but we never got around to it.) So last year I suggested we do electronic forms, in addition to the paper forms (which we entered into the electronic system by hand, afterwards).

The forms we ended up with (all pointed to from illustrate one kind of application it’s easy to do in XForms. To answer, up front, a frequently asked question: no, they don’t do anything you couldn’t do in Javascript or HTML Forms plus a little bit of Javascript. (Javascript is a Turing-complete language; how could any technology do anything that could not, in principle, be done in Javascript? Asking if XForms can do things you couldn’t do in Javascript is like asking whether the XForms spec contains a refutation of Gödel’s Theorem.) Doing them in XForms made these forms easier to develop and debug, and XForms provide XML output, which means the forms are easier to summarize and analyse than they would otherwise be. I have written conventional HTML forms interfaces to generate XML, so I know it’s possible. I also know it’s tedious; XForms is much much more convenient.

These feedback forms posed a few interesting design challenges, and I went through several iterations, bugging my colleagues on the organizing committee for feedback until I suspect most of them were heartily sick of the whole thing. The various alternatives are worth some discussion; in subsequent posts I’ll discuss the issues and some of the alternative ways of handling them in XForms.