Search in sources :

Example 1 with DocumentBuilder

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

the class XPathEvaluator method call.

@Override
public XPathSelector call() throws Exception {
    final Processor proc = new Processor(false);
    final Configuration config = proc.getUnderlyingConfiguration();
    final NodeInfo doc = new DocumentWrapper(mSession, mRevision, config);
    final XPathCompiler xpath = proc.newXPathCompiler();
    final DocumentBuilder builder = proc.newDocumentBuilder();
    final XdmItem item = builder.wrap(doc);
    final XPathSelector selector = xpath.compile(mExpression).load();
    selector.setContextItem(item);
    return selector;
}
Also used : DocumentWrapper(org.sirix.saxon.wrapper.DocumentWrapper) Processor(net.sf.saxon.s9api.Processor) Configuration(net.sf.saxon.Configuration) XPathCompiler(net.sf.saxon.s9api.XPathCompiler) DocumentBuilder(net.sf.saxon.s9api.DocumentBuilder) NodeInfo(net.sf.saxon.om.NodeInfo) XPathSelector(net.sf.saxon.s9api.XPathSelector) XdmItem(net.sf.saxon.s9api.XdmItem)

Aggregations

Configuration (net.sf.saxon.Configuration)1 NodeInfo (net.sf.saxon.om.NodeInfo)1 DocumentBuilder (net.sf.saxon.s9api.DocumentBuilder)1 Processor (net.sf.saxon.s9api.Processor)1 XPathCompiler (net.sf.saxon.s9api.XPathCompiler)1 XPathSelector (net.sf.saxon.s9api.XPathSelector)1 XdmItem (net.sf.saxon.s9api.XdmItem)1 DocumentWrapper (org.sirix.saxon.wrapper.DocumentWrapper)1