XForms in Cocoon

Although CForms is the approved way to do forms in Cocoon, it is still possible to use W3C standard XForms. This page is an attempt to gather information on the various ways to use XForms in Cocoon, and how to decide whether you want to do so.

Additions and corrections are welcome.

Background

Whether to use XForms

Let me start by pointing readers to Sylvain Wallez's meaty meditation on the pros and cons of XMLForms (an implementation of XForms in Cocoon) and Woody (known today as CForms). Sylvain points out some reasons why he feels XForms is not adequate for the forms requirements of certain kinds of server-based web applications. However, Sylvain's comments apply to XMLForms, which was superceded by JXForms, and was not based on the final specification for XForms. Can anybody comment on whether the limitations of XMLForms that Sylvain referred to are intrinsic to XForms (the final W3C Recommendation version)?

I started a response, entitled "XMLForms is dead, long live XForms" in my blog at http://dubinko.info/blog/2004/10.html#perm2004-10-13_xmlforms I'm interested in any comments. Eventually, I will fold that entry into the Wiki. -- MicahDubinko

Technical considerations aside, one significant reason to prefer XForms over CForms is that the latter is a Cocoon-only approach. Thus your investment in CForms is tightly coupled to your decision /ability to continue using Cocoon.

Kurt Cagle has listed seven reasons why he believes XForms is the most likely forms technology to integrate into the web infrastructure, and will start gaining real traction in the next year or two.

How to use XForms

Potential approaches

As I looked for XForms implementations, my ideal was an open-source package that would allow client-side XForms functionality without users having to install additional software (such as a plugin). Some of the options are (see http://www.w3.org/MarkUp/Forms/#implementations for a list of implementations):

Experiences with Mozquito DENG

Looking through the list at http://www.w3.org/MarkUp/Forms/#implementations (which still lists Cocoon XMLForms, btw), I found "Mozquito DENG zero-install XForms". (Another helpful XForms implementation list is at http://www.xml.com/pub/a/2003/09/10/xforms.html?page=1.)

The DENG blurb says "Mozquito's latest XForms implementation is fully client-side and written in Actionscript to allow instant deployment for any flash-6-enabled browser on the web... Supported are subsets of CSS2, CSS3, XHTML, XForms, XFrames and SVG."

I tried DENG and have had good success with it, with a few caveats. Good points:

Demos of DENG can be found at http://claus.packts.net/deng/examples/ See e.g. http://claus.packts.net/deng/deng_test.php?f=examples/xforms/textarea.html&debug=1 See also this tutorial at the XForms Institute.

OK, now the caveats:

The caveats don't seem to bad for the time being. Moreover, I feel comfortable with them because I'm not locked in. If I decide on a different solution, I should be able to repurpose the XForms output to some other renderer, such as Chicoon, without much trouble. I haven't done this yet, but I will most likely create an "insert DENG object" transformer that isolates any DENG-specific code from the rest.

I also would like to try FormsPlayer, which claims to be fully XForms compliant, and compare it with DENG. The drawback here of course is that the user has to explicitly download/install the FormsPlayer plugin, and it only works in IE apparently.

Feedback and synergy

I would be interested in hearing from others about their experiences with Cocoon and XForms.

XFormsInCocoon (last edited 2009-09-20 23:42:23 by localhost)