Am 24.07.2008 um 12:01 schrieb Q:
> Looks interesting, but how would you write something like this one?
> <validation message="Either items, nameKey and valueKey or dataset
> must be bound">
Well... you are pretty free in creating your own parser, but this
probably would be:
condition = "(items=SET OR nameKey=UNSET) or (items=UNSET OR
nameKey=SET)", fail="if name is set then valuekey must also be set"
condition = "(dataset=SET OR valueKey =UNSET) or (dataset=UNSET OR
valueKey=SET)", fail="if name is set then valuekey must also be set"
condition = "(items=SET OR nameKey=SET) and (dataset=SET OR
valueKey=SET)", fail="if name or items is set"
but you could probably also do:
condition = "(allBound(items,nameKey) and
anyBound(dataset,valueKey)) or (anyBound(items,nameKey) and
allBound(dataset,valueKey))" fail="..."
which to me looks a bit easier to read - and would actually be what
the message say (at least I think so).
Cheers, Anjo
This archive was generated by hypermail 2.0.0 : Thu Jul 24 2008 - 07:05:53 EDT