XPath/XQuery nilled function

Summary

Returns true for an element that is nilled.

Signatures

fn:nilled(
) as xs:boolean?
fn:nilled(
$arg as node()?
) as xs:boolean?

Properties

The zero-argument form of this function is deterministic, context-dependent, and focus-dependent.
The one-argument form of this function is deterministic, context-independent, and focus-independent.

Rules

If the argument is omitted, it defaults to the context item (.). The behavior of the function if the argument is omitted is exactly the same as if the context item had been passed as the argument.

If $arg is the empty sequence, the function returns the empty sequence.

Otherwise the function returns the result of the dm:nilled accessor as defined in (see ).

Error Conditions

The following errors may be raised when $arg is omitted:

If the context item is absent, dynamic error

If the context item is not a node, type error .

Notes

If $arg is not an element node, the function returns the empty sequence.

If $arg is an untyped element node, the function returns false.

In practice, the function returns true only for an element node that has the attribute xsi:nil="true" and that is successfully validated against a schema that defines the element to be nillable; the detailed rules, however, are defined in .