-
Notifications
You must be signed in to change notification settings - Fork 23
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
MarkLogic predeclared namespaces mismatch #228
Comments
The predefined namespaces list on that page is incomplete. For example, the
runs without errors, showing the correct MarkLogic also provides some functions in modules that need to be explicitly imported to use (e.g. the security functions). It even mixes the two (e.g. for json, it provides MarkLogic 7.0 adds the For The other namespaces are for importable modules provided by MarkLogic. It looks like this plugin is handling those as built-in namespaces/functions, instead of resolving the import statement to the MarkLogic modules directory. NOTE: XQuery 3.0 defines the same set of predeclared namespaces ( |
The list https://github.com/ligasgr/intellij-xquery/blob/master/src/main/java/org/intellij/xquery/reference/namespace/marklogic/MarkLogicPredeclaredNamespaces.java was compiled by me by trying to run random sample of functions from those namespaces without declaring them as I've noticed that the documentation of MarkLogic is not complete in this regard. With regards to importable modules provided by MarkLogic available on that list... |
@ligasgr I'm not sure there is a better way than periodically updating the plugin to support the latest MarkLogic-specific conventions. To echo @rhdunn's comment, the |
One issue with including the functions that are not built-in in the built-in infrastructure, is that code like:
would be valid according to the plugin, whereas it needs an import. The valid form of the code is:
|
In this particular case, I think I would prefer the plugin to continue to require users to import the namespace. In the longer term, maybe the plugin could maintain a lookup of predeclared namespaces and functions, rather than just namespaces? |
@charlessimpson I think that's the only sensible solution. Functions from an external module shouldn't resolve unless the module is explicitly imported. |
It looks like there are some mismatches between the XML namespaces that the plugin thinks MarkLogic predeclares and which ones MarkLogic documents and currently implements in 7, 8, and 9.
The only change from MarkLogic 5 and 6 to 7, 8, and 9 is the addition of semantic built-in functions.
I'm not sure where the list of namespaces in https://github.com/ligasgr/intellij-xquery/blob/master/src/main/java/org/intellij/xquery/reference/namespace/marklogic/MarkLogicPredeclaredNamespaces.java came from, but it doesn't match.
As a related issue, MarkLogic uses XQuery 1.0's predeclared namespaces, not 3.0, when a MarkLogic-specific version isn't used.
The text was updated successfully, but these errors were encountered: