-
Notifications
You must be signed in to change notification settings - Fork 5
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
Function script:invoke and according example not working #19
Comments
Hi, Thanks for reporting this issue (and your kind words about XSLWeb ;-). Somehow the pipeline definition for the script example was removed from request-dispatcher.xsl. This is now restored in the master. When I execute this example in my development environment, everything works fine. But when I try it in a "ready-to-run" distribution, I indeed get the same error. The reason is that I try to make the "ready-to-run" distribution download as small as possibly by making use of the "modules" mechanism of Java, by only including the Java modules that are actually needed by XSLWeb. So I did include the module "java.scripting" but forgot to include the module "jdk.scripting.nashorn", the actual Javascript implementation for the scripting engine. I will make sure the next versions of XSLWeb will include this necessary module. For now, as a quick fix, you can download https://armatiek.nl/downloads/xslweb/windows-x64.zip and unzip its contents in your existing "{install-dir}\jre" directory, overwriting the existing files. This will add the module "jdk.scripting.nashorn" to your installation. I do realize that the extension function script:invoke() is not (yet) documented in the XSLWeb documentation. This is because I once read that the Java scripting engine would be deprecated, but that does not seem to be the case anymore (?). I will try to find some time to document this function. Kind regards, |
Dear Maarten, thank you for the prompt analysis and very helpful explanation. It is particularly useful to know that this only affects the ready-to-run distribution. We use, of course, the WAR distribution in production and the former only for local development. The solution you proposed worked well for me and fixing It would be great if you find time on occasion to document this feature a little more; as well as to have it available also in the future (if that is possible despite the deprecation of Nashorn). In our specific case, we use this functionality of XSLWeb mainly for Markdown-to-HTML Rendering, but its possibilities are endless. Kind regards from Switzerland, |
Hi Chris, I added some documention for the script:invoke() function, see Javascript extension function. I also fixed a bug in this function, sometimes a exception was thrown returning a single object (not an array) from the Javascript function. Kind regards, |
Dear Maarten, the description of It's great to read that the Nashorn Engine has found a new home in OpenJDK and the feature continues in XSLWeb. Kind regard, Chris |
Hello, and first of all, thank you for making this fantastic framework available to the XML community 🙏
After installing
xslweb-ready-to-run-v4.2.0-windows-x64
I noticed that the example forscript:invoke
(script extension function) is not working.To reproduce:
xslweb-ready-to-run-v4.2.0-windows-x64
Obviously, the reason for the "404" is that this example is actually missing in examples/xsl/request-dispatcher.xsl.
But when I locally added the following template
it complains about an
Error evaluating ((attr{id=...}, ...))
.I suppose this second error lies in the function itself, but unfortunately my knowledge of Java is so poor that further research from my side would not be useful.
My platform: Windows 10
The text was updated successfully, but these errors were encountered: