Simon’s worrying about form processing. That’s good, since I’ve got a project in the same domain. He’s written a form handling class in PHP that reads an XHTML form document, augmented with attributes to drive validation. The code cycles through input and validation, preserving valid field values until its satisfied that the form inputs are valid.
It’s worth noting that his validation syntax looks like Schematron.
Now the current versions of Cocoon support a similar model, but the forms are defined as XForms and use Schematron for validation. In that model, the XForm is turned into an HTML form, the inputs are injected back into the XForm, and the resulting XML is validated by applying a Schematron-generated style sheet.
I like using XForms and Schematron since they are portable, so you’re not creating yet-another-forms-description language. I think a hybrid of Simon’s code, XSLT, XForms and Schematron would be a good thing. Probably because I’m frustrated with Cocoon at the moment.
Possibly Related posts (machine generated):