Package org.exist.xquery.value

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


      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()));
        }
      }
    }
    return terms;
View Full Code Here


            StringWriter out = new StringWriter();
            Properties props = new Properties();
            props.setProperty(OutputKeys.INDENT, "yes");
            SAXSerializer serializer = new SAXSerializer(out, props);
            serializer.startDocument();
            for (SequenceIterator i = seq.iterate(); i.hasNext(); ) {
                Item next = i.nextItem();
                next.toSAX(broker, serializer, props);
            }
            serializer.endDocument();
            //TODO : check content
View Full Code Here

                valueSeq = super.eval(contextSequence, contextItem);
                context.popDocumentContext();
            }
            if (!valueSeq.isEmpty()) {
                StringBuilder buf = new StringBuilder();
                for(SequenceIterator i = valueSeq.iterate(); i.hasNext(); ) {
                    Item next = i.nextItem();
                    buf.append(next.getStringValue());
                    if(i.hasNext())
                        buf.append(' ');
                }
View Full Code Here

      currentSequence = contextItem.toSequence();
   
    int pos = context.getContextPosition();
   
//    for (Item item : currentSequence) {
    for (SequenceIterator iterInner = currentSequence.iterate(); iterInner.hasNext();) {
      Item item = iterInner.nextItem();
//      if (currentSequence == item)
//        item = null;

      //UNDERSTAND: work around
View Full Code Here

      currentSequence = contextItem.toSequence();

    int pos = context.getContextPosition();

    Template template = namedTemplates.get(name);
    for (SequenceIterator iterInner = currentSequence.iterate(); iterInner.hasNext();) {
      Item item = iterInner.nextItem();  
     
      //UNDERSTAND: work around
//      if (item instanceof org.w3c.dom.Document) {
//        org.w3c.dom.Document document = (org.w3c.dom.Document) item;
View Full Code Here

       
    // create the output
    MemTreeBuilder builder = context.getDocumentBuilder();
    DocumentBuilderReceiver receiver = new DocumentBuilderReceiver(builder);   
    try {
      SequenceIterator i = result.iterate();
      Item next = i.nextItem();   
      StringBuilder buf = null;
            boolean allowAttribs = true;
            while (next != null) {
          context.proceed(this, builder);
View Full Code Here

    TreeMap<AtomicValue, Sequence> map = new TreeMap<AtomicValue, Sequence>(new ValueComparator(collator));

    Item item;
    AtomicValue value;
    NumericValue firstNaN = null;
    for (SequenceIterator i = selected.iterate(); i.hasNext();) {
      item = i.nextItem();
      value = group_by.eval(selected, item).itemAt(0).atomize(); //UNDERSTAND: is it correct?
      if (!map.containsKey(value)) {
        if (Type.subTypeOf(value.getType(), Type.NUMBER)) {
          if (((NumericValue)value).isNaN()) {
View Full Code Here

            else {
                MemTreeBuilder builder = context.getDocumentBuilder();
                context.proceed(this, builder);

                StringBuilder buf = new StringBuilder();
                for(SequenceIterator i = contentSeq.iterate(); i.hasNext(); ) {
                    context.proceed(this, builder);
                    Item next = i.nextItem();
                    if(buf.length() > 0)
                        buf.append(' ');
                    buf.append(next.getStringValue());
View Full Code Here

                    node,
                    Sequence.EMPTY_SEQUENCE
            };
            context.pushDocumentContext();
            Sequence seq = callback.evalFunction(null, null, params);
            for (SequenceIterator i = seq.iterate(); i.hasNext(); ) {
                Item next = i.nextItem();
                next.copyTo(context.getBroker(), docBuilder);
            }
            context.popDocumentContext();
        }
View Full Code Here

              "doc('" + doc.getURI().toString() + "')/v:version/v:diff/*",
              Sequence.EMPTY_SEQUENCE, AccessContext.TEST);
    } catch (PermissionDeniedException e) {
      throw new XPathException(e);
    }
        for (SequenceIterator i = changes.iterate(); i.hasNext(); ) {
            NodeProxy p = (NodeProxy) i.nextItem();
            Element child = (Element) p.getNode();
            if (child.getNodeType() == Node.ELEMENT_NODE &&
                    child.getNamespaceURI().equals(StandardDiff.NAMESPACE)) {
               NodeId id = parseRef(broker, child, "ref");
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.