Saturday, July 18, 2009

XForms status update

On the 4th June of 2009 the XForms working group requested the advancement of XForms 1.1 to W3C Proposed Recommendation. We have sufficient interoperable implementation experience according to our exit criteria. As you can see in the implementation report, there are XForms 1.1 implementations that run natively in the browser (Mozilla XForms), can be run in the browser by using JavaScript (Ubiquity and EMC XForms) or run on the server by using AJAX (Chiba). There is of course Orbeon another server side implementation that implements a lot of the new features from XForms 1.1. This gives you a lot of different possibilities, to use the power of XForms 1.1, when creating web applications in todays web browsers.

The XForms working group is also working hard on the future version(s) of the XForms recommendation. Some of the 'smaller' new features are a dialog control, a data driven switch, a case function (retrieve the selected case using an XPath function), Node 'create' XPath functions and passing event 'context' information to the dispatch and dispatch related actions. These features will increase the power and the ease of authoring even more.

One of the bigger new features is the optional support of XPath 2.0 as an expression language in XForms. As most of my colleagues know, I'm a big fan of XPath 2.0, so it isn't too surprising that this is one of my favorite new features for XForms.

Orbeon already supports XPath 2.0 for quite some time. I recently added support for XPath 2.0 to Chiba 3.0 . So there is already quite some experience about how XPath 2.0 could be added as an expression language in XForms. Nevertheless there is still quite some work to do. There are still some things that need further thinking and we need to come to an agreement about some other things too. You may expect updates on the progress of this feature from me on this blog. I'm also thinking about doing some posts about exciting things you can do with XPath 2.0 in XForms.

Another exciting new feature is 'reusable components'. This will allow the form author to create 'complex' components or sub-forms that may contain their own instance and/or model and can be (re-)used in forms, possibly in different places in the form.An XForms implementer, or even a form author, can create libraries of components that can be used by form authors across all different XForms implementations. Examples of components are a map component, a Social Security Number component, an address component, ... This feature still needs a lot of work, and the chance of it being ready for XForms 1.2 is quite small in my opinion. So this feature is probably a good candidate for XForms 2.0.

If you are interested in following what the XForms Working Group is doing, your can follow the public mailing list, our wiki (or more specific for possible XForms 1.2 features) or wait for our first Working drafts of XForms 1.2 and XForms 2.0.

These were just some examples of new features the XForms WG is working on. All the features are still 'work in progress' and there is no guarantee that they will be available in the next version of XForms or the version after that. The availability depends on the progress we make on the feature and how important the community, the Working Group and the implementers ranks the feature.

3 comments:

Alain Couthures said...

XForms is now interesting more and more people but Javascript frameworks allow graphical features not yet present in XForms... Mixing XForms and such frameworks sounds inevitable ?

At least, in next XForms versions, XPath 2.0 functions will be very useful. XSLTForms, my own client-side implementation with XSLT and Javascript, even permits to add XPath functions written in Javascript.

XSLT support is also interesting whether as a new kind of action or another XPath function(s). Some formats such as XBRL are not always very easy to directly manipulate with XForms/XPath only. XSLTForms will have it soon.

A sub-form mechanism is required for designing a complete web application. Doesn't Chiba have one ?

Reusable components is a very interesting feature but in which language should they be written : XSLT ? XBL ?

The next XSLTForms release will also contain a formula extension allowing users to type formulas such as "13+29" instead of "42". Excel users do this every day so XForms should ! Symbolic computations could even be integrated because mobile phones can do this already today...

Nick Van den bleeken said...

Alain thank you for the good reply.

From the first version of XForms there were integration possibilities between JavaScript and XForms. A processor could give script access to the XForms instances using getInstanceDocumen. There are also the functions rebuild, recalculate, revalidate and refresh which can be called from script. You have the ability to listen and send events from JavaScript because XML Events is based on DOM model of events.

Additionally most XForms implementations have an extension to allow scripts as action handlers. If we switch to XML Events 2 in XForms 1.2, which is likely, there is a standard way to support scripts as actions too.

One of the new features I didn't mention in my blog post is, besides the script action handlers, the addition of custom XPath functions. We probably will support a standard way to define those custom functions (like you can in XSLT 2.0) but we will also add a way to add custom functions which are defined in an implementation defined way (which could be JavaScript).

Today there are also already a lot of web browser based XForms implementations that use JavaScript frameworks like YUI, Dojo, JQuery to render UI components, document traversing, event handling, Ajax interactions, ... Most of those implementations also have a way to define and bind 'custom' UI controls that can use those JavaScript framework using some implementation dependent extension. But if we do our work well, this could be done in a standard way using 'custom' components in a future version of XForms.

We are still in the stage of gathering requirements for the 'custom' components new feature. We talked a bit about how current implementations support it today with extensions. But it is too early to say how it is going to be implemented in the XForms recommendation. One implementation that we talked about is Orbeon, they do it today using XBL.

I would say, that there are already quite some integration possibilities between JavaScript and XForms today, but even more are about to be introduced in future versions of XForms.

Dan McCreary said...

How about support for drag-and-drop? That would really help!

I also have some examples of composite controls:

http://en.wikibooks.org/wiki/XForms/Tri-Document_Loading

controls:http://en.wikibooks.org/wiki/XForms/Entity_Selection