With XQuery you can use library modules within your query. They can be imported via
import module namespace mynamespace = 'com.mynamespace' at 'filename.xq';
The question is: is there a way to determine which file is associated with the module namespace so that the programmer can decide dynamically?
For example, my dynamic configuration tells that mynamespace should be associated with filename1.xq ...
import module namespace mynamespace = 'com.mynamespace' at 'filename1.xq';
and then, perhaps after some user clicks, myfile2.xq should be used?
import module namespace mynamespace = 'com.mynamespace' at 'myfile2.xq';
If you use Java & Saxon, you can use perhaps the ModuleURIResolver, but the resolver is part of the commercial, non-free Enterprise Edition. Is there a workaround for this problem if you are in a Java environment?