Package org.exist.xquery.value

Examples of org.exist.xquery.value.SequenceIterator.nextItem()


      if(getSignature().getArgumentCount() == 2)
        {zero = getArgument(1).eval(contextSequence, contextItem);}
      result = zero;
    } else {
        final SequenceIterator iter = inner.iterate();
        Item item = iter.nextItem();
        AtomicValue value = item.atomize();

          value = check(value, null);
       
        //Set the first value
View Full Code Here


          value = check(value, null);
       
        //Set the first value
        ComputableValue sum = (ComputableValue) value;
        while (iter.hasNext()) {
          item = iter.nextItem();
          value = item.atomize();

              value = check(value, sum);
         
            if (Type.subTypeOf(value.getType(), Type.NUMBER)) {
View Full Code Here

                }
               
    buf.append(") ");
   
    while(i.hasNext()) {
      final Item next = i.nextItem();
      if( Type.subTypeOf( next.getType(), Type.NODE ) ) {
        final Serializer serializer = context.getBroker().getSerializer();
        serializer.reset();
        try {
          buf.append( serializer.serialize( (NodeValue)next ) );
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);
        // if item is an atomic value, collect the string values of all
View Full Code Here

                buf = new StringBuilder();
          else if (buf.length() > 0)
            buf.append(' ');
          buf.append(next.getStringValue());
                    allowAttribs = false;
                    next = i.nextItem();            // if item is a node, flush any collected character data and
        //  copy the node to the target doc.
        } else if (Type.subTypeOf(next.getType(), Type.NODE)) {
                    if (buf != null && buf.length() > 0) {
            receiver.characters(buf);
            buf.setLength(0);
View Full Code Here

                    if (next.getType() == Type.ATTRIBUTE && !allowAttribs)
                        throw new XPathException(this, "XQTY0024: An attribute may not appear after " +
                            "another child node.");
                    next.copyTo(context.getBroker(), receiver);
                    allowAttribs = next.getType() == Type.ATTRIBUTE;
                    next = i.nextItem();
        }
            }
      // flush remaining character data
      if (buf != null && buf.length() > 0)
        receiver.characters(buf);
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);
        // if item is an atomic value, collect the string values of all
View Full Code Here

                buf = new StringBuilder();
          else if (buf.length() > 0)
            buf.append(' ');
          buf.append(next.getStringValue());
                    allowAttribs = false;
                    next = i.nextItem();            // if item is a node, flush any collected character data and
        //  copy the node to the target doc.
        } else if (Type.subTypeOf(next.getType(), Type.NODE)) {
                    if (buf != null && buf.length() > 0) {
            receiver.characters(buf);
            buf.setLength(0);
View Full Code Here

                    if (next.getType() == Type.ATTRIBUTE && !allowAttribs)
                        throw new XPathException(this, "XQTY0024: An attribute may not appear after " +
                            "another child node.");
                    next.copyTo(context.getBroker(), receiver);
                    allowAttribs = next.getType() == Type.ATTRIBUTE;
                    next = i.nextItem();
        }
            }
      // flush remaining character data
      if (buf != null && buf.length() > 0)
        receiver.characters(buf);
View Full Code Here

  public Sequence eval( Sequence[] args, Sequence contextSequence ) throws XPathException
  {
    List <InetSocketAddress> ialist = new ArrayList <InetSocketAddress>();
    SequenceIterator i = args[0].iterate();
    do {
      Properties props = ModuleUtils.parseProperties( ((NodeValue) i.nextItem()).getNode() );
      String host = props.getProperty("host");
      String tmp  = props.getProperty("port");
      int    port  = tmp == null ? 11211 : new Integer(tmp).intValue();  
      InetSocketAddress ia = new InetSocketAddress(host, port);
      ialist.add(ia);
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.