Package org.exist.xquery

Examples of org.exist.xquery.XQuery.compile()


    XQueryContext context;
    if (feedQuery == null) {
      context = xquery.newContext(AccessContext.REST);
      try {
        feedQuery = xquery.compile(context, entryByIdSource);
      } catch (final XPathException ex) {
        throw new EXistException("Cannot compile xquery "
            + entryByIdSource.getURL(), ex);
      } catch (final IOException ex) {
        throw new EXistException(
View Full Code Here


    XQueryContext context;
    if (feedQuery == null) {
      context = xquery.newContext(AccessContext.REST);
      try {
        feedQuery = xquery.compile(context, getFeedSource);
      } catch (final XPathException ex) {
        throw new EXistException("Cannot compile xquery "
            + getFeedSource.getURL(), ex);
      } catch (final IOException ex) {
        throw new EXistException(
View Full Code Here

                // Allow use of modules with relative paths
                String moduleLoadPath = StringUtils.substringBeforeLast(path, "/");
                context.setModuleLoadPath(moduleLoadPath);

                // Compile query
                CompiledXQuery compiledQuery = service.compile(context, source);

                LOG.info(String.format("Starting Xquery at '%s'", path));

                // Finish preparation
                context.prepareForExecution();
View Full Code Here

                    {context = compiled.getContext();}
                context.setStaticallyKnownDocuments(new XmldbURI[] { pathUri });
                context.setBaseURI(new AnyURIValue(pathUri.toString()));

                if (compiled == null)
                    {compiled = xquery.compile(context, source);}
                else {
                    compiled.getContext().updateContext(context);
                    context.getWatchDog().reset();
                }
View Full Code Here

      context.setDebuggeeJoint(null);
      context.undeclareGlobalVariable(Debuggee.SESSION);
      context.undeclareGlobalVariable(Debuggee.IDEKEY);
     
      XQuery service = broker.getXQueryService();
      CompiledXQuery compiled = service.compile(context, script);
     
      Sequence resultSequence = service.execute(compiled, null);
 
          SAXSerializer sax = null;
          Serializer serializer = broker.getSerializer();
View Full Code Here

      // Find correct script load path
      queryContext.setModuleLoadPath(XmldbURI.create(uri).removeLastSegment().toString());
 
      CompiledXQuery compiled;
      try {
        compiled = xquery.compile(queryContext, source);
      } catch (IOException e) {
        e.printStackTrace();
        return null;
      }
         
View Full Code Here

                    }
                }

                if(compiled == null) {
                    try {
                        compiled = xquery.compile(context, source, xpointer != null);
                    } catch (final IOException e) {
                        throw new SAXException("I/O error while reading query for xinclude: " + e.getMessage(), e);
                    }
                }
                LOG.info("xpointer query: " + ExpressionDumper.dump((Expression) compiled));
View Full Code Here

           
            if(catalogPath!=null){
                context.declareVariable(CATALOG, catalogPath);
            }
           
            compiled = xquery.compile(context, new ClassLoaderSource(queryPath) );
           
            result = xquery.execute(compiled, null);
           
        } catch (final Exception ex) {
            logger.error("Problem executing xquery", ex);
View Full Code Here

        final long contentLength = request.getContentLength();
        while ((len = r.read(buffer)) >= 0 && count < contentLength) {
          count += len;
          builder.append(buffer, 0, len);
        }
        compiledQuery = xquery.compile(context, new StringSource(builder.toString()));
     
      } catch (final XPathException ex) {
        throw new EXistException("Cannot compile xquery.", ex);
      } catch (final IOException ex) {
        throw new EXistException(
View Full Code Here

    XQueryContext context;
    if (feedQuery == null) {
      context = xquery.newContext(AccessContext.REST);
      context.setModuleLoadPath(getContext().getModuleLoadPath());
      try {
        feedQuery = xquery.compile(context, config.querySource);
      } catch (final XPathException ex) {
        throw new EXistException("Cannot compile xquery "
            + config.querySource.getURL(), ex);
      } catch (final IOException ex) {
        throw new EXistException(
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.