cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Oliver <res1c...@verizon.net>
Subject [RT] XMLForm
Date Sun, 25 May 2003 19:30:13 GMT
I received a private communication from Ivelin suggesting to replace the 
XMLForm block with the JXForms implementation in the scratchpad, 
incorporating features he added in his xmlform.org code for the 2.1 release.

I think this is a good idea as it will eliminate the fork, however I 
think a discussion about the design and future development of this form 
framework (and others) is needed.

XMLForm works well with the current Flowscript implementation in part 
because they both use JXPath. At least, Sylvain thinks so:
http://mdsme.de/cgi-bin/nph-spinnerproxy.cgi/010110A/http/www.anyware-tech.com/blogs/sylvain/archives/000041.html

The use of JXPath allows XMLForm to automatically populate the 
Flowscript objects with values from the request, and to make those same 
objects available for validation using Schematron. This makes it 
significantly more user-friendly for a Flowscript author than using raw 
sendPageAndWait() and writing your own validation loop, for example:

XMLForm:

  function myForm(form) {
      form.setModel(...);
      form.sendView("my/views/form/page1.xml");
  }

Using plain flowscript:

  function myForm() {
         var model = ...;
         while (true) {
                 sendPageAndWait("my/views/form/page1.xml", model);
                 /* for each parameter: */
                 var paramValue = cocoon.request.get(paramName);
                 if  (/* paramValue is valid */) {
                        model[paramName] = paramValue;
                        break;
                 }
         }
  }


Unfortunately, however, the stylesheets that are shipped with XMLForm 
are not generic, but instead, apparently, must be reused in a 
cut-and-paste fashion, and modified for each application.

In addition, it seems quite awkward to incorporate an XMLForm form into 
a larger application. For example, in the petstore sample, Leo had to 
merge the XMLForm stylesheets as special cases in the main application 
stylesheet. I attempted to improve this in JXForms, but I think it needs 
the attention of someone with more expertise than I have.

Finally, the documentation of XMLForm is, in my opinion, completely 
inadequate and must be significantly improved if we expect widespread 
use. Each syntactic element should be documented and examples of its use 
provided. Documentation of the functionality provided by each stylesheet 
is also needed.

Please, add you comments.

Regards,

Chris


Mime
View raw message