RE: [F&O] CER-07 exactly-one et al

> How can a user write a function that statically reduces the type and
> raises an error if the dynamic cardinality is too big?
> Best regards
> Michael

Perhaps I'm missing something, but I don't see why these don't do the 
trick.
The rules for sequence type matching allow you to report this either 
statically
or dynamically:


define function exactly-one ( $items as item() ) as item()*
{
   $items
}

define function one-or-more ( $items as item()+ ) as item()*
{
   $items
}

define function zero-or-more ( $items as item()* ) as item()*
{
   $items
}

//Mary

Received on Tuesday, 17 February 2004 13:16:34 UTC