Package net.sf.saxon.query

Examples of net.sf.saxon.query.XQueryExpression


    public Node evaluateAsDOM(Exchange exchange) throws Exception {
        initialize(exchange);

        DOMResult result = new DOMResult();
        DynamicQueryContext context = createDynamicContext(exchange);
        XQueryExpression expression = getExpression();
        expression.pull(context, result, properties);
        return result.getNode();
    }
View Full Code Here


    public Node evaluateAsDOM(Exchange exchange) throws Exception {
        initialize(exchange);

        DOMResult result = new DOMResult();
        DynamicQueryContext context = createDynamicContext(exchange);
        XQueryExpression expression = getExpression();
        expression.pull(context, result, properties);
        return result.getNode();
    }
View Full Code Here

    Configuration config = null;
        Properties props = new Properties();
        props.setProperty(OutputKeys.METHOD, "xml");
        props.setProperty(OutputKeys.INDENT, "yes");
   
    XQueryExpression exp = implementation.getCompiledExpressionsCache().get(xqExpression);
    if(exp == null) {
      config = new Configuration();
      StaticQueryContext sqc = new StaticQueryContext(config);
      exp = sqc.compileQuery(xqExpression);
      implementation.getCompiledExpressionsCache().put(xqExpression, exp);
    } else {
      config = exp.getStaticContext().getConfiguration();
    }
   
    Object [] params = prepareParameters(payload, config, props);
   
    DynamicQueryContext dynamicContext = new DynamicQueryContext(config);
   
    // Setting the parameters for function invokation
    String methodName = theMethod.getName();
    for(int i=0; i<params.length; i++) {
      dynamicContext.setParameter(methodName+"_"+i, params[i]);
    }
   
    // Setting references
    for(Map.Entry<String, Object> entry : referenceProxies.entrySet()) {
      dynamicContext.setParameter(entry.getKey(), entry.getValue());
    }
   
    // Setting properties
    for(Map.Entry<String, Object> entry : properties.entrySet()) {
      dynamicContext.setParameter(entry.getKey(), transformProperty(entry.getValue(), config));
    }
       
    SequenceIterator iterator = null;
    Configuration oldConfigValue = SaxonDataBindingHelper.CURR_EXECUTING_CONFIG;
    SaxonDataBindingHelper.CURR_EXECUTING_CONFIG = config;
    try {
      iterator = exp.iterator(dynamicContext);
    } finally {
      SaxonDataBindingHelper.CURR_EXECUTING_CONFIG = oldConfigValue;
    }
        Item item = iterator.next();
        if(item == null) {
View Full Code Here

   
    xqExpression += "\r\n<dummy></dummy>";
   
    Configuration config = new Configuration();
        StaticQueryContext sqc = new StaticQueryContext(config);
        XQueryExpression exp = null;
    try {
      exp = sqc.compileQuery(xqExpression);
    } catch (XPathException e) {
      throw new ContributionResolveException(e);
    }
View Full Code Here

    public Node evaluateAsDOM(Exchange exchange) throws Exception {
        initialize(exchange);

        DOMResult result = new DOMResult();
        DynamicQueryContext context = createDynamicContext(exchange);
        XQueryExpression expression = getExpression();
        expression.pull(context, result, properties);
        return result.getNode();
    }
View Full Code Here

    public Node evaluateAsDOM(Exchange exchange) throws Exception {
        initialize(exchange);

        DOMResult result = new DOMResult();
        DynamicQueryContext context = createDynamicContext(exchange);
        XQueryExpression expression = getExpression();
        expression.pull(context, result, properties);
        return result.getNode();
    }
View Full Code Here

        LOG.debug("evaluateAsDOM: {} for exchange: {}", expression, exchange);
        initialize(exchange);

        DOMResult result = new DOMResult();
        DynamicQueryContext context = createDynamicContext(exchange);
        XQueryExpression expression = getExpression();
        expression.pull(context, result, properties);
        return result.getNode();
    }
View Full Code Here

    public Node evaluateAsDOM(Exchange exchange) throws Exception {
        initialize(exchange);

        DOMResult result = new DOMResult();
        DynamicQueryContext context = createDynamicContext(exchange);
        XQueryExpression expression = getExpression();
        expression.pull(context, result, properties);
        return result.getNode();
    }
View Full Code Here

    public Node evaluateAsDOM(Exchange exchange) throws Exception {
        initialize(exchange);

        DOMResult result = new DOMResult();
        DynamicQueryContext context = createDynamicContext(exchange);
        XQueryExpression expression = getExpression();
        expression.pull(context, result, properties);
        return result.getNode();
    }
View Full Code Here

        // Create a dummy main query module and compile it
        StaticQueryContext sqc = new StaticQueryContext(getConfiguration());
        sqc.setExecutable(getExecutable());
        sqc.setBaseURI(getBaseURI());
        String mainModule = "import module namespace m = \"" + moduleURI + "\" at \"" + href + "\"; ()";
        XQueryExpression exp = sqc.compileQuery(mainModule);
        return exp.getStaticContext();
    }
View Full Code Here

TOP

Related Classes of net.sf.saxon.query.XQueryExpression

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.