Open line-o opened 1 year ago
I would not expect either to work, and I suspect the fact that one of them works is more of a bug than by design. The XQuery spec states:
the context for evaluating a function body or for a variable's initializing expression is defined based on the context of the module in which the function or variable is defined.
It also states:
Module imports are not transitive—that is, importing a module provides access only to function and variable declarations contained directly in the imported module.
function-lookup
should be called on the static context of Module ctx
, and it should not find a function named a:f
or app:f
as they are not imported into the ctx
module.
@adamretter please see the discussion and answers here https://stackoverflow.com/questions/74408887/scope-and-statically-known-namespaces-in-xquery
Also note that the above works in baseX 10 and Saxon 11
This sparked also a discussion about rewording the XQuery specification to clarify its meaning: https://github.com/qt4cg/qtspecs/issues/239
I do agree though that it would make sense for the function-lookup
to not work. This was my expectation, but I works and across implementations.
NOTE: This is a follow-up on a question I posted on StackOverflow
consider a library module
ctx
and a library module
a
And a main module