Examples of ValueSequence


Examples of org.exist.xquery.value.ValueSequence

                if (!tv.getTimezone().isEmpty()) {
                    if (!((DayTimeDurationValue)dv.getTimezone().itemAt(0))
                        .compareTo(null, Constants.EQ,
                            ((DayTimeDurationValue)tv.getTimezone().itemAt(0)))) {
                       
                      final ValueSequence argsSeq = new ValueSequence();
                        argsSeq.add(dv);
                        argsSeq.add(tv);
                       
                        throw new XPathException(this, ErrorCodes.FORG0008,
                            "Operands have different timezones", argsSeq);
                    }
                }
View Full Code Here

Examples of org.exist.xquery.value.ValueSequence

            return Sequence.EMPTY_SEQUENCE;
        }

        if (isCalledAs("available-environment-variables")) {

            final Sequence result = new ValueSequence();

            final Map<String, String> env = context.getEnvironmentVariables();
            for (final String key : env.keySet()) {
                result.add(new StringValue(key));
            }

            return result;

        } else {
View Full Code Here

Examples of org.exist.xquery.value.ValueSequence

        throws XPathException {
    if(startingLoc.getInt() <= 1) {
      //start value is 1 or less, so just return the string
      return new StringValue(sourceString);
    }
        final ValueSequence codepoints = FunStringToCodepoints.getCodePoints(sourceString);
        // transition from xs:string index to Java string index.
        return new StringValue(FunStringToCodepoints.subSequence(codepoints, startingLoc.getInt() - 1));
   }
View Full Code Here

Examples of org.exist.xquery.value.ValueSequence

   *
   * @return The StringValue of the substring
   */
  private StringValue substring(String sourceString, NumericValue startingLoc, NumericValue endingLoc)
        throws XPathException {
        final ValueSequence codepoints = FunStringToCodepoints.getCodePoints(sourceString);
        // transition from xs:string index to Java string index.
        return new StringValue(FunStringToCodepoints.subSequence(codepoints,
                                                                 startingLoc.getInt() - 1,
                                                                 endingLoc.getInt() - 1));
  }
View Full Code Here

Examples of org.exist.xquery.value.ValueSequence

        final Sequence arg = getArgument(0).eval(contextSequence, contextItem);
        Sequence result;
        if (arg.isEmpty()) {
            result = Sequence.EMPTY_SEQUENCE;
        } else {
            result = new ValueSequence();
            Item item;
            for (final SequenceIterator i = arg.iterate(); i.hasNext(); ) {
                item = i.nextItem();
                result.add(item.atomize());
            }
View Full Code Here

Examples of org.exist.xquery.value.ValueSequence

    } else {
            if (seq instanceof NodeSet) {
                tmp = new ExtArrayNodeSet();
                ((ExtArrayNodeSet)tmp).keepUnOrdered(unordered);
            } else {
                tmp = new ValueSequence();
                ((ValueSequence)tmp).keepUnOrdered(unordered);
            }
           
           
            tmp = seq.tail();
View Full Code Here

Examples of org.exist.xquery.value.ValueSequence

            if (seq instanceof NodeSet) {
              result = new ExtArrayNodeSet();
              result.addAll((NodeSet) seq);
              result = ((NodeSet)result).except((NodeSet) seq.itemAt(pos));
            } else {
              result = new ValueSequence();
              for (int i = 0; i < seq.getItemCount(); i++) {
                if (i != pos) {result.add(seq.itemAt(i));}
              }             
            }
            }
View Full Code Here

Examples of org.exist.xquery.value.ValueSequence

    String localName = null;   
    try {
      prefix = QName.extractPrefix(param);
      localName = QName.extractLocalName(param);
        } catch (final IllegalArgumentException e) {
                final ValueSequence argsSeq = new ValueSequence(args[0]);
                argsSeq.addAll(args[1]);
          throw new XPathException(this, ErrorCodes.FOCA0002, "Invalid lexical form of either prefix or local name.", argsSeq);
        }

    if ((prefix != null && prefix.length() > 0) && (namespace == null || namespace.length() == 0)){
                final ValueSequence argsSeq = new ValueSequence(args[0]);
                argsSeq.addAll(args[1]);
                throw new XPathException(this, ErrorCodes.FOCA0002, "Non-empty namespace prefix with empty namespace URI", argsSeq);
        }
   
    if (namespace != null) {
      if (namespace.equalsIgnoreCase(Namespaces.XMLNS_NS))
View Full Code Here

Examples of org.exist.xquery.value.ValueSequence

      i++;
    }
   
    FastQSort.sort(items, 0, contextSequence.getItemCount()-1);
   
    result = new ValueSequence();
    for (i = 0; i < items.length; i++)
      result.add(items[i].getItem());
   
    return result;
  }
View Full Code Here

Examples of org.exist.xquery.value.ValueSequence

  public String getName() {
    return name;
  }   

  public Sequence eval(Sequence contextSequence, Item contextItem) throws XPathException {
    Sequence result = new ValueSequence();
   
    if (use_attribute_sets != null) {
      result.addAll(
          ((XSLContext)context).getXSLStylesheet()
            .attributeSet(use_attribute_sets, contextSequence, contextItem)
          );
    } else if (delay_use_attribute_sets != null) {
      return getXSLContext().getXSLStylesheet().attributeSet(delay_use_attribute_sets, contextSequence, contextItem);
    }
     
    result.addAll( super.eval(contextSequence, contextItem) );
   
    return result;
  }
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.