Thanks for the resolution hint and the clue that there is no error when running locally.
I dug a bit deeper. It seems running modules via http shines a light on some less common codepaths #[2091]
I get an error from just:
[XQST0049] Duplicate declaration of static variable $_:basePath.
I note that:
- "changes.xqm" imports "utils.xqm" and "data/changes.xqm"
-
"data/changes.xqm" imports "../utils.xqm"
So utils.xqm is imported with two different paths and BaseX fails to spot it is the same file when the transport is https
but it does spot they are the same when these are local files. I think this is correct, BUT it is not the true problem.
I believe the true problem is the raising of
error XQST0049, regardless of whether the imports of utils.xqm are the same file or not.
Because: Module imports are not transitive #[2048] and in particular:
"module A does not have access to the variables declared in module C"
There is no
"Duplicate declaration of static variable" in this case because "changes.xqm" should not be able to see what is imported by
"data/changes.xqm"
The variables are defined in different scopes. Saxon XQuery runs with no error.
/Andy