Hi Joseph,

This works for me. Where parser.bat is creating out.xml in the folder where the xquery is running.
This maybe a case of trying to stop the optimizer, some simpler versions of this did not work

let $uri-process:=file:resolve-path("parser.bat",static-base-uri())
let $uri-output:=file:resolve-path("out.xml",static-base-uri())
let $_:=proc:execute($uri-process)
return doc($uri-output)

/Andy

On 9 October 2015 at 18:10, meumapple <meumapple@gmail.com> wrote:
I reforward this email, if anyone knows about this problem:

I have used the proc:execute function  for a java command and it works. I use that to invoke a linguistic parser whose output is by default written into a file (XML). I would like to open such a file with doc(), but doc() is processed before the file created with proc:execute is written into the file. What is the best way to force doc() to wait until the file outputted by proc:execute is written? Thanks.

J.

Ps: is there any significant difference in performance between using java bindings and proc:execute?

Il giorno 03/ott/2015, alle ore 10:21, Christian Grün <christian.gruen@gmail.com> ha scritto:

I see. In that case, you should add the JAR file to your classpath and
address this class in your XQuery code via our Java binding [1]. If
the JAR file cannot be added to the classpath, you will need to start
a separate Java process and address via the process module:
proc:system("java", "-jar", "...") [2].

[1] http://docs.basex.org/wiki/Java_Bindings
[2] http://docs.basex.org/wiki/Process_Module


> On Sat, Oct 3, 2015 at 3:11 AM, meumapple <meumapple@gmail.com> wrote:
> Hi Cristian,
>
> Yes, I mean the main method of the class specified in the main-class header in MANIFEST, which is executed when you command: java -jar file.jar
>
> Thanks!
> J.
>
> Il giorno 02/ott/2015, alle ore 12:04, Christian Grün <christian.gruen@gmail.com> ha scritto:
>
> Hi Joseph,
>
>> It is not clear to me if I can run from XQuery a .jar file (it is a simple linguistic parser). Any idea about that? Thanks.
>
> To me, it's not clear what you mean with "running a jar file"? Would
> you like to invoke the class that's specified in the MANIFEST.MF file,
> or any other class?
>
> Christian