Question

I cannot find an example or indication on how to call XML Calabash (an Xproc implementation) to be run from Java. The requirements are simple:

  1. List item Be able to programatically specify inputs and outputs.
  2. List item Be able to work concurrently since we want it to be a process running in a Jetty Server

    • Thanks
Was it helpful?

Solution

You should have a look at Servlex and in particular here https://github.com/fgeorges/servlex/tree/master/servlex/src/java/org/expath/servlex/processors

Hope this helps

OTHER TIPS

Yes, you can look at Servlex, in particular https://github.com/fgeorges/servlex/tree/master/servlex/src/java/org/expath/servlex/processors/saxon, and more precisely CalabashXProc and CalabashPipeline.

For now, Servlex is compiling the pipeline for every execution, as the separation between compile time and runtime is not perfect in Calabash. Servlex used to cache the result of the compilation and reset it after each usage, but if two requests come at the same time, then they actually use the same dynamic evaluation environment, which means, well, BOOM!

Norm is working on it and made some progress, but I guess it wouldn't hurt to make him hear your voice if you need to be able to cache compiled pipelines and evaluate several instances of it concurrently (by writing to XProc Dev or in Calabash issue tracker).

If you are interested in Servlex, the website is at http://servlex.net/. If you want to run pipelines to respond to HTTP requests, it is probably a good choice as it already contains a lot of the boilerplate code, and let you write your pipelines in a declarative way (what request URI it responds to is declared in a webapp descriptor, and it manipulates the HTTP request and generates the HTTP response as XML documents). It is an implementation of the EXPath Web Applications specification (link on Servlex's website)

PS: Sorry for the lack of direct links, but StackOverflow does not allow me to post more than 2 links (which I can understand actually...)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top