cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hunsberger, Peter" <>
Subject RE: XMLForm & JSF
Date Wed, 09 Apr 2003 14:29:17 GMT
ivelin <> wrote:
> Thanks for the feedback, Peter and Bruno.

Your welcome, this is an issue near and dear to us so I have a vest interest
in see what everyone else is doing...
> The recommended practice for validation with XMLForm is to 
> apply two stage validation. First stage is lightweight and 
> evaluates only rules refering to the form model itself. 
> Examples are verifying whether a field is a number within a 
> predefined range or a valid email address. Use Schematron for 
> lightweight validation. The second stage, when necessary, is 
> heavier in the sense that it consults with data storage or 
> remote sources of information to evaluate a rule. This 
> validation stage is usually specialized to the problem domain 
> and is best implemented with the appropriate tools at hand.
> Does this make any sense?

Well, yes and no.  Yes in the sense that it make sense to separate business
rule (work flow type things) validation from presentation validation.  No in
that I'm not sure that the processes for doing the two types of validation
necessarily have to be different?  Perhaps since basic date validation,
number validation, etc. is common and can be easily coded (relative to
business rules) perhaps it makes sense to just have a bunch of common Java
classes hanging around for handling that type of validation.  Since business
rules can be complex and often need a lot of maintenance maybe having them
buried in a bunch of Java code might be not so good (I realize you said
"appropriate tools").  As such, XSLT and it's rules handing capabilities
might make more sense for the business rules related stuff (heavy weight
tools for heavy weight rules evaluation)?

> Localization is not built in Schematron and I am not sure 
> that it should be. Here is an email from Rick Jeliffe, the 
> Schematron author, that addresses the issue: 
> He simply recommends that schemas should be written for each 
> language. German schema for german rules with german text, 
> english for english, etc. What that means for XMLForm is that 
> there needs to be a mechanism to lookup Validator with 
> associated schema per locale. This is already available in 
> Commons Validator, but the solution seems somewhat 
> counterintuitive to me.
I had given a little thought about using different Schematron for different
locales but hadn't explored it yet.  If you consider that any common
validation can be included in the locale specific validation that makes a
lot of sense.  You can also use the same mechanism for choosing which
Schematron to use as it used for picking properties files...

View raw message