On Thu, 20 Jun 2013 06:07:47 -0700, Iain Tatch <[email protected]> wrote:
> Hi all
>
> Following a discussion at work we're curious to find out if there is any
> meaningful advantage to declaring that a function's return type is
> item() as opposed to not declaring any return type.
>
> In other words, is there any difference at all to the way MarkLogic treats:
>
> declare function foo() as item() {
> ...
> };
>
> and
>
> declare function foo() {
> ...
> };
>
>
>
There is, because the first one will check cardinality.
(That is: is there exactly one result in the result
sequence?)
However, declaring the return type as item()* will
be handled exactly the same as not declaring a
return type at all.
//Mary
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general