fn:exactly-one( $arg as item()* ) as item()
Returns $arg if it contains exactly one item. Otherwise, raises an error [err:FORG0005].
For detailed type semantics, see Section 7.2.16 The fn:zero-or-one, fn:one-or-more, and fn:exactly-one functions[FS].
Parameters | |
---|---|
arg | The sequence of items. |
fn:exactly-one(("hello")) => "hello" fn:exactly-one(("hello", "goodbye")) => XDMP-NOTONEITEM exception (because there are 2 items)
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.