cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Torsten Curdt" <>
Subject RE: [RT] forms
Date Thu, 19 Jul 2001 17:42:02 GMT
> I've implemented something similar:
> My form descriptor is similar to the XForms WD. I've made some
> simplifications and some enhancements to allow simple processing and
> validation definitions.
> example form control:
>     <textbox ref="person/user-id">
>         <caption>User ID</caption>
>         <validate type="null">User ID must be specified.</validate>
>         <validate type="string" minlen="5" maxlen="20">The User ID must
> have 5 to 20 characters</validate>
>         <validate type="unique">The User ID is already used. Please enter
> an other.</validate>
>     </textbox>


> For presentation the form descriptor is transformed by a special XSLT
> sheet. I make heavy use of the xalan:evaluate() extension to fill the
> instance data in the form (dont know a XSLT conform solution to resolve the
> ref attributes). Then the evaluated form page is transformed to HTML Forms
> and sent to the client. I use the values of the ref attributes as HTML form
> control names.

Why do you use xalan:evaluate() to fill in the data?

> The response from the client (ServletRequest) is evaluated by an Action. On
> the first request of the form an XMLFragment (Node, DocumentFragment) is
> created from the default instance data in the form descriptor or the
> referenced XML data (using XLink). The request values from the HTML form
> are validated and written to the DOM Node. The DOM Node is saved as request
> attribute or in the session if needed over more requests (multipage forms).


> If the submitted form data is not valid according to the information in the
> form descriptor the Action redirects the user request to the form
> presentation again. There I use an extented TraxTransformer to pass the
> updated DOM Node (instance data) and the validation result to the XSLT
> sheet as parameters (as XPath node-set).

Hmm... we should get around without redirects...

> Currently I operate only on XML files - no database or business objects
> involved.
> My multipage solution is very simple. I define a total number of pages in
> my form descriptor and the same amount of form elements with corresponding
> page attributes:
> <form-descriptor pages="3">
>     <instance/>
>     <form page="1"/>
>     <form page="2"/>
>     <form page="3"/>
> </form-descriptor>
> The disadvantage of this solution is that only multi page forms with a
> sequential process can be declared. But I dont need other ;-)
> I would like to donate my stuff. But I must admit its a very raw hack and
> needs lots of refactoring. And I've only implemented the things I really
> needed for my project (of course ;).

I think that's great!
I'm really optimistic to have a standard sollution soon!

To unsubscribe, e-mail:
For additional commands, email:

View raw message