It looks like when compiling xquery to JVM bytecode from the command line, the context item must still be specified at compile-time. Is there a way to produce a class file from an XQuery script without specifying the context item, knowing that the context item will be specified at run-time using applyWithFocus?
(My particular requirements are to use a binary serialization of XML and pre-compile several hundred xquery scripts to bytecode before applying them to perhaps several terabytes of binary-serialized XML -- hence the unusual questions.)
Thanks! That's exactly what I was looking for.
On 09/10/2015 09:12 PM, John Ohno wrote:
> I'm sorry -- I think my question wasn't clear enough.
>
> I don't want to specify an XML filename. I want to specify an already-parsed DOM Document or Node object -- because my source file is in FastInfoset format, not XML.
First, note that Qexo doesn't know anything about FastInfoset, so you have to convert it to
either XML source, or Qexo's Node representation (gnu.kawa.xml.KNode). (Jus using something
that implements org.w3c.dom.Node probably won't work.) You can use SAX to do convert
from FastInfoset to Qexo's imlementation.
Once you have a Node (or more genberally a sequence of items) how you run some XQuery
with that as the context node (or context sequence)? For that look into
gnu/xquery/lang/XQuery.java. It contains a number of helper methods you can use.
--
--Per Bothner
address@hidden http://per.bothner.com/