JavaScript (and other languages) API for XForms
Rationale
See Erik's comments below on Google+.
Requirements
The API must expose useful aspects of the XForms runtime, including:
- access to XForms actions such as setfocus, setindex, toggle, send, dispatch, etc.
- access to XForms functions such as index(), etc.
- access XForms control properties such as a control's value, etc.
- read/write/mutate XForms instances, possibly through a DOM API and/or insert/delete/setvalue
The API implementation ensures the XForms processing model, including deferred updates.
The current rebuild, recalculate, revalidate, refresh are available, but a simple update() method that either runs all four, or runs the ones indicated by deferred update flags, would be more user-friendly.
NOTE: Some consideration would have to be given as to how to do IDREF resolution. The spec resolves IDREFS based on location of invocation relative to the referent. Is that still possible from script?
References
Added Erik Bruchez 22:27, 29 August 2011 (UTC)
- Orbeon wiki on the topic: http://wiki.orbeon.com/forms/projects/xforms-support-server-side-javascript
- Google+ thread on the need for a "solid JavaScript API": https://plus.google.com/u/0/114141433688365651943/posts/aGDpEJX7jj8
- Experiment to describe actions with JS, CoffeeScript, XQuery, and Scala: https://gist.github.com/790257