It seems as if Saxon handles the empty sequence as a special case. The
following query..

   trace( (1,2), "Trace: ")

..will create similar output in BaseX, Saxon, Zorba and other
processors while Saxon is the only one (I tried) to return output for
an empty sequence, such as...

  trace( (), "Trace: ")

The specification does not enforce a certain behavior on how to handle
sequences [1], which is why different solution have been chosen.

Hope this helps,
Christian

[1] http://www.w3.org/TR/xpath-functions-30/#func-trace
_______________________________

> My query is of the form:
>
> if (not(empty($variable))) then
>        ... return some XML...
> else
>        fn:trace((), "Warning : Variable is empty")
>
> After your reply I tried the following to see if I  remove the optimization, 
> but not luck - still no output on stderr:
>
> if (not(empty($variable))) then
>        ... return some XML...
> else
>        $result := fn:trace((), "Warning : Variable is empty")
>        return $result
_______________________________________________
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk

Reply via email to