[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qexo-general] Problem with java implementation
From: |
jvinel |
Subject: |
Re: [Qexo-general] Problem with java implementation |
Date: |
Tue, 31 Dec 2002 13:38:18 +0100 (CET) |
I finally found a way to have the result of a query in a file by using the
Shell class :
Interpreter.defaultInterpreter = Interpreter.getInstance("xquery");
Interpreter interp = Interpreter.defaultInterpreter;
File file = new File("test.xml");
FileOutputStream fops=new FileOutputStream(file);
PrintWriter result=new PrintWriter(fops);
Environment env = interp.getEnvironment();
OutPort caop=new OutPort(result,"test");
caop.setErrDefault(caop);
String request="for $x in (1,2,3) return <result>{$x}</result>";
CharArrayInPort caip=new CharArrayInPort(request);
Shell.run(interp,env,caip,caop,caop.errDefault());
Julien