Search in sources :

Example 1 with SAXDestination

use of net.sf.saxon.s9api.SAXDestination in project sirix by sirixdb.

the class XQueryEvaluatorSAXHandler method call.

@Override
public Void call() throws Exception {
    try {
        final Processor proc = new Processor(false);
        final Configuration config = proc.getUnderlyingConfiguration();
        final NodeInfo doc = new DocumentWrapper(mSession, config);
        final XQueryCompiler comp = proc.newXQueryCompiler();
        final XQueryExecutable exp = comp.compile(mExpression);
        final net.sf.saxon.s9api.XQueryEvaluator exe = exp.load();
        exe.setSource(doc);
        exe.run(new SAXDestination(mHandler));
        return null;
    } catch (final SaxonApiException e) {
        LOGGER.error("Saxon Exception: " + e.getMessage(), e);
        throw e;
    }
}
Also used : XQueryExecutable(net.sf.saxon.s9api.XQueryExecutable) DocumentWrapper(org.sirix.saxon.wrapper.DocumentWrapper) Processor(net.sf.saxon.s9api.Processor) Configuration(net.sf.saxon.Configuration) NodeInfo(net.sf.saxon.om.NodeInfo) XQueryCompiler(net.sf.saxon.s9api.XQueryCompiler) SAXDestination(net.sf.saxon.s9api.SAXDestination) SaxonApiException(net.sf.saxon.s9api.SaxonApiException)

Aggregations

Configuration (net.sf.saxon.Configuration)1 NodeInfo (net.sf.saxon.om.NodeInfo)1 Processor (net.sf.saxon.s9api.Processor)1 SAXDestination (net.sf.saxon.s9api.SAXDestination)1 SaxonApiException (net.sf.saxon.s9api.SaxonApiException)1 XQueryCompiler (net.sf.saxon.s9api.XQueryCompiler)1 XQueryExecutable (net.sf.saxon.s9api.XQueryExecutable)1 DocumentWrapper (org.sirix.saxon.wrapper.DocumentWrapper)1