Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for fn:load-xquery-module #2346

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

GuntherRademacher
Copy link
Member

@GuntherRademacher GuntherRademacher commented Nov 25, 2024

These changes add support for fn:load-xquery-module. Besides the actual function implementation, the following had to be changed:

  • QueryContext has a new member public SeqType contextType. This is also stored in StaticContext, but the sc 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 flag cast, and it will cast values only if the flag is set, otherwise they will be coerced.
  • the atomization of 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

  • support QName values of test-case/environment/param/@name,
  • support location-to-file mapping via test-case/module/@location,
  • remove fn-load-xquery-module from the list of non-supported features,
  • skip tests explictly asking for no support of a feature that is actually supported.

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.

@GuntherRademacher GuntherRademacher marked this pull request as draft November 25, 2024 14:04
@GuntherRademacher GuntherRademacher changed the title Load xquery module Add support for fn:load-xquery-module Nov 25, 2024
@GuntherRademacher GuntherRademacher marked this pull request as ready for review November 25, 2024 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant