Sylvain Wallez wrote:
I once proposed that validators could produce a small snippet of JS that would be included in the produced page. However, this somehow mixes some client-side technology in the validators which isn't a good thing.
So the idea now is that a validator produces an XML representation of itself, which could be a simple as it's definition translated to the "fi:" namespace.
E.g.
<fd:field id="foo" required="true"> <fd:datatype base="integer"/> <fd:validation> <fd:range min="1" max="10"/> </fd:validation> </fd:field>
would produce <fi:field id="foo"> <fi:datatype type="integer"/> <fi:validation> <fi:required> <fi:range min="1" max="10"/> </fi:validation> </fi:field>
It's then the job of the presentation XSLs to transform <fi:range> into something useful.
Only those validators where a client-side implementation is possible would produce an XML fragment in the <fi:validation> element.
WDYT?
Sylvain
In my previous work, I did something much like this, and it worked quite well. I'm heading out the door for travel, but when I return I'll jump in here.
Thanks,
.micah
