Package org.exist.xquery

Examples of org.exist.xquery.Expression


  }

  public void validate() throws XPathException {
    boolean canBeParam = true;
    for (int pos = 0; pos < this.getLength(); pos++) {
      Expression expr = this.getExpression(pos);
     
      if (expr instanceof TextConstructor) {
        continue;//ignore text elements
      }
View Full Code Here


 
  private double computedPriority() {
    double priority = 0.5;
    if (match != null)
      if (match.getLength() > 0) {
        Expression expr = match.getExpression(0);
        if (expr instanceof LocationStep) {
          LocationStep locationStep = (LocationStep) expr;
          NodeTest test = locationStep.getTest();
          if ((test.getName() == null)
              || (test.getName().getLocalName() == null))
View Full Code Here

  }
 
  public boolean isSmallWildcard() {
    if (match != null)
      if (match.getLength() > 0) {
        Expression expr = match.getExpression(0);
        if (expr instanceof LocationStep) {
          LocationStep locationStep = (LocationStep) expr;
          NodeTest test = locationStep.getTest();
          if (test instanceof TypeTest) {
            if (test.getName() == null)
View Full Code Here

    if (match == null)
      return false;
   
    boolean matched = false;
    for (int i = match.getLength()-1; i >= 0; i--) {
      Expression expr = match.getExpression(i);
      if (!expr.match(contextSequence, item))
        return false;
      if (expr instanceof LocationStep) {
       
        item = (Item)((NodeValue)item).getNode().getParentNode();
      }
View Full Code Here

        return (XSLContext) getContext();
    }

    public void validate() throws XPathException {
        for (int pos = 0; pos < this.getLength(); pos++) {
            Expression expr = this.getExpression(pos);
            if (expr instanceof XSLPathExpr) {
                XSLPathExpr xsl = (XSLPathExpr) expr;
                xsl.validate();
            }
        }
View Full Code Here

        return null;
  }

    protected void _check_(Expression path) {
        for (int index = 0; index < path.getSubExpressionCount(); index++) {
            Expression expr = path.getSubExpression(index);
            if ((index == 0) && (expr instanceof LocationStep)) {
                LocationStep location = (LocationStep) expr;
                if (location.getTest().isWildcardTest())
                    ;
                else if (location.getAxis() == Constants.CHILD_AXIS) {
View Full Code Here

        }
    }

    protected void _check_childNodes_(Expression path) {
        if (path.getSubExpressionCount() != 0) {
            Expression expr = path.getSubExpression(path.getSubExpressionCount()-1);
            if (expr instanceof LocationStep) {
                LocationStep location = (LocationStep) expr;
                //TODO: rewrite
                if (location.getAxis() == Constants.ATTRIBUTE_AXIS)
                    ;
View Full Code Here

            if (contextItem != null)
                {context.getProfiler().message(this, Profiler.START_SEQUENCES,
                        "CONTEXT ITEM", contextItem.toSequence());}
        }
          
    final Expression arg0 = getArgument(0);
    final Expression arg1 = getArgument(1);

    if (contextItem != null)
      {contextSequence = contextItem.toSequence();}
     
    final Sequence seq1 = arg0.eval(contextSequence);
    final Sequence seq2 = arg1.eval(contextSequence);

        String value;
        String cmp;
        Sequence result;
    if (seq1.isEmpty()) {
View Full Code Here

        if(contextItem != null)
      {contextSequence = contextItem.toSequence();}
   
        Sequence result;
        boolean processInMem = false;
        final Expression arg = getArgument(0);       
    final Sequence idrefval = arg.eval(contextSequence);
    if(idrefval.isEmpty())
            {result = Sequence.EMPTY_SEQUENCE;}
        else {
        String nextId;
        DocumentSet docs = null;
View Full Code Here

     * @see org.exist.xquery.Function#setArguments(java.util.List)
     */
    public void setArguments(List<Expression> arguments) throws XPathException {
        // wrap arguments into a cardinality check, so an error will be generated if
        // one of the arguments returns an empty sequence
        Expression arg = arguments.get(0);
        arg = new DynamicCardinalityCheck(context, Cardinality.ONE_OR_MORE, arg,
                new Error(Error.FUNC_PARAM_CARDINALITY, "1", mySignature));
        steps.add(arg);
       
        arg = arguments.get(1);
View Full Code Here

TOP

Related Classes of org.exist.xquery.Expression

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.