Provides an execution trace intended to be used in debugging queries.
The function returns the value of
In addition, the values of
$value, converted to an
may be directed to a trace data set. The destination of the trace
output is implementation-defined. The format of the trace output is
implementation-dependent. The ordering of output from calls of the
fn:trace function is implementation-dependent.
Consider a situation in which a user wants to investigate the actual value passed to
a function. Assume that in a particular execution,
$v is an
xs:decimal with value
'the value of $v is:') will put the strings
"the value of $v is:" in the trace data set in implementation
Sometimes there is a need to output trace information unrelated to a specific value.
In such cases it can be useful to set
$value to an empty string or an empty
sequence, and to compute the value of the
fn:trace((), "Processing item " || $i).