This is a trivial simplification of my attempt to develop a function in the MarkLogic XQuery manager. The function I am trying to write must be capable of receiving a null node as input. I've been trying to pass ()
to mean "empty node" and it seems to just crash without any sort of trace.
For example, the trivial example shown is expected to simply return the figure "1", but does not. If I instead pass a small non-empty XML document then the trivial example works.
What is wrong with my reasoning, please, on passing an empty node?
declare function local:x ($i as node()) as xs:string*
{ let $x := "1"
return $x
};
local:x ( () );