Package org.exist.xquery.value

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


        if (sSerializeParams.hasOne() && Type.subTypeOf(sSerializeParams.getItemType(), Type.NODE)) {
            SerializerUtils.getSerializationOptions(this, (NodeValue) sSerializeParams.itemAt(0), outputProperties);
        } else {
            SequenceIterator siSerializeParams = sSerializeParams.iterate();
            while(siSerializeParams.hasNext()) {
                final String serializeParam = siSerializeParams.nextItem().getStringValue();
                final String opt[] = Option.parseKeyValuePair(serializeParam);
                if(opt != null && opt.length == 2) {
                    outputProperties.setProperty( opt[0], opt[1] );
                }
            }
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

        try {
            if(!contentSeq.isEmpty()) {
                StringBuilder buf = null;
                final SequenceIterator i = contentSeq.iterate();
                Item next = i.nextItem();
                while(next != null) {
                    context.proceed(this, builder);
                    if (next.getType() == Type.ATTRIBUTE || next.getType() == Type.NAMESPACE)
                        {throw new XPathException(this, "Found a node of type " +
                            Type.getTypeName(next.getType()) + " inside a document constructor");}
View Full Code Here

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

                        if (buf != null && buf.length() > 0) {
                            receiver.characters(buf);
                            buf.setLength(0);
                        }
                        next.copyTo(context.getBroker(), receiver);
                        next = i.nextItem();
                    } 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 (buf != null && buf.length() > 0) {
                            receiver.characters(buf);
                            buf.setLength(0);
                        }
                        next.copyTo(context.getBroker(), receiver);
                        next = i.nextItem();
                    }
                }
                // flush remaining character data
                if (buf != null && buf.length() > 0) {
                    receiver.characters(buf);
View Full Code Here

        final MemTreeBuilder builder = context.getDocumentBuilder();
        final DocumentBuilderReceiver receiver = new DocumentBuilderReceiver(builder);
        receiver.checkNS = true;
        try {
            final 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 the 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)) {
                 
                    //It is possible for a text node constructor to construct a text node containing a zero-length string.
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.