XForms 1.1 added dynamically computed submissions and many other improvements to XForms 1.0. The resultant language turned out to be far more than a forms language, but a declarative application language. Since XForms has input, output, and a processing engine, XForms is Turing-complete, and much more than just forms is now possible with the language.
XForms 2.0 (W3C Working Draft of August 2012): http://www.w3.org/TR/xforms20/ , http://www.w3.org/TR/xforms-xpath/ adds further
- XPath 2.0, which itself includes large parts of XQuery and is very powerful!
- Custom functions, Variable support, Pluggable expression language (XPath 2.0 module), script actions
- json, csv and other external instance data formats
- model-based case switching (i.e. declarative show/hide)
- Attribute Value Template support (i.e. dynamically computed attributes)
Anecdotal experiences:
- application production time can be reduced by an order of magnitude. One large project reporting a reduction from 5 years with 30 programmers using traditional programming, to 1 year with 10 programmers using XForms.
- XForms code is less than 25% of the original #JavaScript code (so a tenth of the work).
- (2 days after hearing about a complex forms task)
Javascript dev: I'll need 30 days to work out how long it will take to program it
XForms dev: I've already done it.
Myself and Sirma ITT have looked at XForms as early as 2007 for a Customs project.
The spec was immature and the implementations available at the time were not quite efficient.
However, there are efficient implementations now (xsltforms, orbeon, better forms).
Definitely worth looking into.
Links:
- http://homepages.cwi.nl/~steven/Talks/2012/02-11-steven-json/examples.html
Examples including caclulations, display of the same data in various controls that are automatically synchronized, multilanguage processing, handling of tables/arrays (repeats), displaying a map, autocomplete using a REST service returning JSON (10-20 lines of declarative XML!),
- http://homepages.cwi.nl/~steven/Talks/2012/02-11-steven-json/
Describes a simple mapping of XSON to the XDM model used in XForms, so now XForms can handle JSON receptions (instances) and submissions.
- http://archive.xmlprague.cz/2012/sessions.html#Treating-JSON-as-a-subset-of-XML-Using-XForms-to-read-and-submit-JSON
Above talk was part of XML Prague 2012. I've read many of the presentations and proceedings (papers): a most excellent conference!!
Ethan Gruber has created XForms (EADitor) for entering Numismatic information (Nomisma-NUDS).
They include dynamic calls to various APIs, eg to VIAF to obtain person names/URIs.