XPath/XQuery empty function

Summary

Returns true if the argument is the empty sequence.

Signature

fn:empty(
$arg as item()*
) as xs:boolean

Properties

This function is deterministic, context-independent, and focus-independent.

Rules

If the value of $arg is the empty sequence, the function returns true; otherwise, the function returns false.

Examples

The expression fn:empty((1,2,3)[10]) returns true().

The expression fn:empty(fn:remove(("hello", "world"), 1)) returns false().

The expression fn:empty([]) returns false().

The expression fn:empty(map{}) returns false().

The expression fn:empty("") returns false().

Assuming $in is an element with no children:

let $break := <br/> return fn:empty($break)

The result is false().