Examples of PathExpr


Examples of org.exist.xquery.PathExpr

                throw new RemoteException(parser.getErrorMessage());
            }
           
            final AST ast = parser.getAST();
           
            final PathExpr expr = new PathExpr(context);
            treeParser.xpath(ast, expr);
            if (treeParser.foundErrors()) {
                LOG.debug(treeParser.getErrorMessage());
                throw new EXistException(treeParser.getErrorMessage());
            }
            LOG.info("query: " + ExpressionDumper.dump(expr));
            final long start = System.currentTimeMillis();
            expr.analyze(new AnalyzeContextInfo());
            final Sequence seq= expr.eval(null, null);
           
            QueryResponseCollection[] collections = null;
            if (!seq.isEmpty() && Type.subTypeOf(seq.getItemType(), Type.NODE))
                {collections = collectQueryInfo(scanResults(seq));}
            session.addQueryResult(seq);
            resp.setCollections(new QueryResponseCollections(collections));
            resp.setHits(seq.getItemCount());
            resp.setQueryTime(System.currentTimeMillis() - start);
            expr.reset();
            context.reset();
        } catch (final Exception e) {
            LOG.debug(e.getMessage(), e);
            throw new RemoteException("query execution failed: " + e.getMessage());
        } finally {
View Full Code Here

Examples of org.exist.xquery.PathExpr

            AST ast = parser.getAST();
            if (ast == null)
                throw new XPathException("Unknown XQuery parser error: the parser returned an empty syntax tree.");

            PathExpr expr = new PathExpr(context);
            if (xpointer)
                treeParser.xpointer(ast, expr);
            else
                treeParser.xpath(ast, expr);
            if (treeParser.foundErrors()) {
                throw new StaticXQueryException(
                treeParser.getErrorMessage(),
                treeParser.getLastException());
            }

            expr.analyze(new AnalyzeContextInfo(context));

//            if (context.optimizationsEnabled()) {
//                Optimizer optimizer = new Optimizer(context);
//                expr.accept(optimizer);
//                if (optimizer.hasOptimized()) {
View Full Code Here

Examples of org.exist.xquery.PathExpr

      final AST ast = parser.getAST();
     
      if (LOG.isDebugEnabled())
        {LOG.debug("generated AST: " + ast.toStringTree());}

      final PathExpr expr = new PathExpr(context);
      treeParser.xpath(ast, expr);
      if (treeParser.foundErrors()) {
        throw new SAXException(treeParser.getErrorMessage());
      }
      expr.analyze(new AnalyzeContextInfo());
      final Sequence seq = expr.eval(null, null);
      return seq;
    } catch (final RecognitionException e) {
      LOG.warn("error while creating variable", e);
      throw new SAXException(e);
    } catch (final TokenStreamException e) {
View Full Code Here

Examples of org.exist.xquery.PathExpr

  private Sort sort = null;
 
  public ForEach(XSLContext context) {
    super(context);
   
    childNodes = new PathExpr(getContext());
    childNodes.add(new LocationStep(getContext(), Constants.CHILD_AXIS, new AnyNodeTest()));

  }
View Full Code Here

Examples of org.exist.xquery.PathExpr

                //TODO : error ?
                LOG.debug(parser.getErrorMessage());
            }
            final AST ast = parser.getAST();
            LOG.debug("generated AST: " + ast.toStringTree());
            expr = new PathExpr(context);
            treeParser.xpath(ast, expr);
            if (treeParser.foundErrors()) {
                LOG.debug(treeParser.getErrorMessage());
            }
            expr.analyze(new AnalyzeContextInfo());
View Full Code Here

Examples of org.exist.xquery.PathExpr

        throw new XPathException(this, "error found while executing expression: " +
          parser.getErrorMessage());
      }
      final AST ast = parser.getAST();
     
      final PathExpr path = new PathExpr(pContext);
      astParser.xpath(ast, path);
      if(astParser.foundErrors()) {
        throw astParser.getLastException();
      }
      path.analyze(new AnalyzeContextInfo());
    } catch (final RecognitionException e) {     
      error = e.toString();
    } catch (final TokenStreamException e) {
      error = e.toString();
    } catch (final XPathException e) {
View Full Code Here

Examples of org.jaxen.expr.PathExpr

          NumberExpr numberExpr1 = (NumberExpr)o1;
          NumberExpr numberExpr2 = (NumberExpr)o2;
          cmp = new Double(numberExpr1.getNumber().doubleValue()).compareTo(new Double(numberExpr2.getNumber().doubleValue()));
          break;
        case TYPE_PATH_EXPR:
          PathExpr pathExpr1 = (PathExpr)o1;
          PathExpr pathExpr2 = (PathExpr)o2;
          cmp = compare(pathExpr1.getLocationPath(), pathExpr2.getLocationPath());
          if (cmp == 0)
          {
            cmp = compare(pathExpr1.getFilterExpr(), pathExpr2.getFilterExpr());
          }
          break;
        case TYPE_PREDICATE:
          Predicate predicate1 = (Predicate)o1;
          Predicate predicate2 = (Predicate)o2;
View Full Code Here

Examples of org.jaxen.expr.PathExpr

          NumberExpr numberExpr1 = (NumberExpr)o1;
          NumberExpr numberExpr2 = (NumberExpr)o2;
          cmp = new Double(numberExpr1.getNumber().doubleValue()).compareTo(new Double(numberExpr2.getNumber().doubleValue()));
          break;
        case TYPE_PATH_EXPR:
          PathExpr pathExpr1 = (PathExpr)o1;
          PathExpr pathExpr2 = (PathExpr)o2;
          cmp = compare(pathExpr1.getLocationPath(), pathExpr2.getLocationPath());
          if (cmp == 0)
          {
            cmp = compare(pathExpr1.getFilterExpr(), pathExpr2.getFilterExpr());
          }
          break;
        case TYPE_PREDICATE:
          Predicate predicate1 = (Predicate)o1;
          Predicate predicate2 = (Predicate)o2;
View Full Code Here

Examples of xbird.xquery.expr.path.PathExpr

                            return mapExpr.staticAnalysis(statEnv);
                        }
                    }
                }
            } else if(expr instanceof PathExpr) {
                PathExpr pathExpr = (PathExpr) expr;
                List<XQExpression> steps = pathExpr.getSteps();
                if(steps.size() > 1) {
                    XQExpression firstStep = steps.get(0);
                    if(firstStep instanceof DirectFunctionCall) {
                        DirectFunctionCall funcall = (DirectFunctionCall) firstStep;
                        if(FnCollection.FUNC_NAME.equals(funcall.getFuncName())) {
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.