-
Notifications
You must be signed in to change notification settings - Fork 18
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
fontoxpath:evaluate
can't see functions defined in XQuery, but can see those defined with registerCustomXPathFunction
#513
Comments
Hey Reuben, That is an old issue: functions that are declared with Not sure what to do here to be honest. I mean, on one hand, we can just re-import the modules-in-scope from the module that calls On the other hand, you could add an explicit module import: Seeing as you are basically half of the (known) user-base of this function (Fonto is the other user 😉), I'm open for discussion here! What are your thoughts? |
Thanks very much for your detailed, helpful and friendly reply. My perspective is as follows: on the one hand, Ruth (my project) is basically a wrapper around XQuery (so, fontoxpath), and currently a proportion of the code is simply workarounds for gaps in fontoxpath's XQuery functionality. (This is no disrespect to fontoxpath: I seem to have a tendency to write small programs much of whose code consists of workarounds for whatever libraries I'm using.) Hence, I would like fontoxpath to be as complete an implementation of XQuery/XPath as possible. On the other hand, I have fairly limited use cases for Ruth, so I am not testing a wide range of XQuery functionality. You could say that at present my use of XQuery is quite "deep" (I use most of the different "mechanisms") but not very "broad" (e.g. I don't use a wide range of functions). So overall, I am happiest if over time I can reduce the amount of workaround/polyfill code I have in Ruth with principled additions to fontoxpath. In this particular case, I tried using your tip, and indeed that makes my custom functions visible; but I then have a similar problem with a variable |
I have updated my I find that I would also need to import other modules dynamically (for example in my It would be good to better understand the downsides of doing that. I would imagine that normally I would want |
Calling
fontoxpath:evaluate
, I am getting errors like this:Here,
ruth:real-path
(the function suggested) is defined withregisterCustomXPathFunction
, whileruth:relative-path
(the function that the evaluation can't find) is defined in XQuery that has been loaded withregisterXQueryModule
. I don't understand why one is visible tofontoxpath:evaluate
but not the other.I pushed a branch of my project that illustrates the problem when you run
npm test
, but I quite understand if that is too much code to go through—I can try to prepare a MWE if that's necessary.The text was updated successfully, but these errors were encountered: