When using the XQuery Java API, the QueryStaticContext
is not reset for each new query that is compiled. Since
the static context accumulates data about things such
as global variables, namespace declarations, and the
like, this means that arbitrary failures can occur when
the QueryStaticContext is reused.
Fixing this will require some rethinking of the API.
For the time being, a reset() method has been added to
the QueryStaticContext object.
Circumvention: create a new QueryProcessor object, or
at the least a new QueryStaticContext object, for each