qexo-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qexo-general] Using qexo from Java with unusual input & output form


From: John Ohno
Subject: Re: [Qexo-general] Using qexo from Java with unusual input & output formats
Date: Fri, 11 Sep 2015 16:11:06 +0000

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.)

On Thu, Sep 10, 2015 at 4:05 PM John Ohno <address@hidden> wrote:
Thanks! That's exactly what I was looking for.

On Thu, Sep 10, 2015 at 4:00 PM Per Bothner <address@hidden> wrote:


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/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]