|
From: | Per Bothner |
Subject: | Re: [Qexo-general] Using the Qexo API |
Date: | Thu, 22 May 2003 23:50:08 -0700 |
User-agent: | Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.4b) Gecko/20030507 |
Alessandro Vernet wrote:
import gnu.xquery.lang.XQuery; import java.io.StringWriter; public class Test { public static void main(String[] args) { try { XQuery xquery = new XQuery(); StringWriter resultWriter = new StringWriter(); xquery.eval("<a/>", resultWriter);System.out.println("Result: ->" + resultWriter.toString() + "<-");} catch (Throwable throwable) { throw new RuntimeException(throwable); } } } Running this with Kawa 1.7 beta, here is what I get on the standard output: Result: -><- ) Any idea or suggestion?
Adding an extra XMLPrinter helps: public class Test { public static void main(String[] args) throws Throwable { XQuery xquery = new XQuery(); StringWriter resultWriter = new StringWriter(); XMLPrinter xmlPrinter = new XMLPrinter(resultWriter); xquery.eval("<a/>", xmlPrinter); // xmlPrinter.flush(); // optional System.out.println("Result: ->" + resultWriter.toString() + "<-"); } } Now I agree your program should work, and I've made some fixes, but I have to think about things more before I check them in. -- --Per Bothner address@hidden http://per.bothner.com/
[Prev in Thread] | Current Thread | [Next in Thread] |