Add support for fn:load-xquery-module #2346
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
These changes add support for
fn:load-xquery-module
. Besides the actual function implementation, the following had to be changed:QueryContext
has a new memberpublic SeqType contextType
. This is also stored inStaticContext
, but thesc
of a parsed module was not accessible in the function implementation, where the context type is needed for type checking and coercion.Variables.bindExternal
has a new flagcast
, and it will cast values only if the flag is set, otherwise they will be coerced.Options
values has been removed. This was necessary to allow for node values being passed to the loaded module's external variables.The test infrastructure had to be changed to
QName
values oftest-case/environment/param/@name
,test-case/module/@location
,fn-load-xquery-module
from the list of non-supported features,There are 81 specific QT4 tests for
fn:load-xquery-module
, this implementation succeeds for all of them. Also some more tests are turning from failure to success, because they are affected by the changes made here.