Examples of itemAt()


Examples of org.exist.xquery.value.Sequence.itemAt()

        // check if the node is passed as an argument or should be taken from
        // the context sequence
        if(getArgumentCount() > 0) {
            final Sequence seq = getArgument(0).eval(contextSequence);
            if (!seq.isEmpty())
                {item = seq.itemAt(0);}
        } else {
          if (contextSequence == null || contextSequence.isEmpty())
            {throw new XPathException(this, ErrorCodes.XPDY0002, "Undefined context item");}
            item = contextSequence.itemAt(0);
        }
View Full Code Here

Examples of org.exist.xquery.value.Sequence.itemAt()

    Sequence result;
        final Sequence seq = getArgument(0).eval(contextSequence, contextItem);
    if (seq.isEmpty())
            {result = Sequence.EMPTY_SEQUENCE;}
        else {
          final Item item = seq.itemAt(0);
          NumericValue value;
          if (item instanceof NumericValue) {
        value = (NumericValue) item;
      } else {
        value = (NumericValue) item.convertTo(Type.NUMBER);
View Full Code Here

Examples of org.exist.xquery.value.Sequence.itemAt()

    Sequence seq;
    for(int i = 1; i < getLength(); i++) {
      next = getArgument(i);
      seq = next.eval(contextSequence);
      if(seq.hasOne())
          {terms.add(translateRegexp(seq.itemAt(0).getStringValue()));}
      else {
        for(final SequenceIterator it = seq.iterate(); it.hasNext(); ) {
            terms.add(translateRegexp(it.nextItem().getStringValue()));
        }
      }
View Full Code Here

Examples of org.exist.xquery.value.Sequence.itemAt()

            String name = null;
            if (qnameExpr != null) {
                Sequence nameSeq = qnameExpr.eval(contextSequence, contextItem);
                if (!nameSeq.hasOne())
                    throw new XPathException(this, "The name expression should evaluate to a single value");
                Item qnItem = nameSeq.itemAt(0);
                if (qnItem.getType() == Type.QNAME)
                    qn = ((QNameValue) qnItem).getQName();
                else
                    name = nameSeq.getStringValue();
            } else {
View Full Code Here

Examples of org.exist.xquery.value.Sequence.itemAt()

        String resource = null;
       
        if (args.length > 3){
          Sequence sec = args[3];
          if (!sec.isEmpty()){
            resource = sec.itemAt(0).getStringValue();
          }
        }
       
        if (resource == null){
          connection.login(user, password);
View Full Code Here

Examples of org.exist.xquery.value.Sequence.itemAt()

    if (result.getItemCount() == 0) //UNDERSTAND: is it correct
      return false;
   
    if (result.getItemCount() != 1)
      throw new XPathException("problem at test");//UNDERSTAND: what to do?
      return ((BooleanValue) result.itemAt(0).convertTo(Type.BOOLEAN)).getValue();
  }

  public Sequence eval(Sequence contextSequence, Item contextItem) throws XPathException {
    return super.eval(contextSequence, contextItem);
  }
View Full Code Here

Examples of org.exist.xquery.value.Sequence.itemAt()

            if(xpe.getErrorCode() == ErrorCodes.XQST0059) {
                final Sequence errorVals = xpe.getErrorVal();
               
                if(errorVals != null && errorVals.getItemCount() > 0){
                   
                    final Item errorVal1 = errorVals.itemAt(0);
                    if(errorVal1 instanceof StringValue) {
                        if(missingModuleHint == null) {
                            missingModuleHint = new MissingModuleHint();
                        }
                        missingModuleHint.moduleHint = ((StringValue)errorVal1).getStringValue();
View Full Code Here

Examples of org.exist.xquery.value.Sequence.itemAt()

                        }
                        missingModuleHint.moduleHint = ((StringValue)errorVal1).getStringValue();
                    }
                   
                    if(errorVals.getItemCount() == 2) {
                        final Item errorVal2 = errorVals.itemAt(1);
                        if(errorVal2 instanceof StringValue) {
                            if(missingModuleHint == null) {
                                missingModuleHint = new MissingModuleHint();
                            }
                           
View Full Code Here

Examples of org.exist.xquery.value.Sequence.itemAt()

                    propertyName = "IS_VALID";
                } else {
                    logger.error("Unknown spatial property: " + mySignature.getName().getLocalName());
                    throw new XPathException("Unknown spatial property: " + mySignature.getName().getLocalName());
                }
                NodeValue geometryNode = (NodeValue)nodes.itemAt(0);
                if (geometryNode.getImplementationType() == NodeValue.PERSISTENT_NODE) {
                    //The node should be indexed : get its property
                    result = indexWorker.getGeometricPropertyForNode(context, (NodeProxy)geometryNode, propertyName);
                    hasUsedIndex = true;
                } else {
View Full Code Here

Examples of org.exist.xquery.value.Sequence.itemAt()

        ValueSequence result = new ValueSequence();
        AbstractDateTimeValue d1 = (AbstractDateTimeValue)item;
        DurationValue diff = (DurationValue)args[1].itemAt(0);
        Sequence seq = args[2].convertTo(Type.INTEGER);
        int count = ((NumericValue)seq.itemAt(0).convertTo(Type.INTEGER)).getInt();
        if (count < 0)
            count = 0;

        // loop through dates/times
        while(count-- > 0)
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.