Examples of itemAt()


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

                }
                if (!Type.subTypeOf(nodes.itemAt(0).getType(), Type.NODE)) {
                    logger.error(ErrorCodes.XPTY0004 + " fn:id() argument is not a node");
                  throw new XPathException(this, ErrorCodes.XPTY0004, "XPTY0004: fn:id() argument is not a node", nodes);
                }
                NodeValue node = (NodeValue)nodes.itemAt(0);
                if (node.getImplementationType() == NodeValue.IN_MEMORY_NODE)
                  //TODO : how to enforce this ?
                  //If $node, or the context item if the second argument is omitted,
                  //is a node in a tree whose root is not a document node [err:FODC0001] is raised                    processInMem = true;
                    {processInMem = true;}
View Full Code Here

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

                    item = i.nextItem();
                    tmp.add(item);
                }
                result = new ValueSequence();
                for (int i = seq.getItemCount() - 1; i >= 0; i--) {
                    result.add(tmp.itemAt(i));
                }
        }

        if (context.getProfiler().isEnabled())
            {context.getProfiler().end(this, "", result);}
View Full Code Here

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

           
        if (getSignature().getArgumentCount() > 1) {
          precision = (IntegerValue) getArgument(1).eval(contextSequence, contextItem).itemAt(0).convertTo(Type.INTEGER);
        }
           
          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()

    if (seq.isEmpty()) {     
      result = Sequence.EMPTY_SEQUENCE;
    } else {
      AnyURIValue relative;
      try {
        final Item item = seq.itemAt(0).convertTo(Type.ANY_URI);
        relative = (AnyURIValue)item;
      } catch (final XPathException e) {       
            throw new XPathException(this, ErrorCodes.FORG0002, "invalid argument to fn:resolve-uri(): " + e.getMessage(), seq, e);
      }     
      URI relativeURI;
View Full Code Here

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

            serializer.setProperty(EXistOutputKeys.HIGHLIGHT_MATCHES, highlight);
           
            Item item;
            int j = 0;
            for (int i = --start; i < start + howmany; i++, j++) {
                item = seq.itemAt(i);
                if (item == null)
                    {continue;}
                if (item.getType() == Type.ELEMENT) {
                    final NodeValue node = (NodeValue) item;
                    xml[j] = serializer.serialize(node);
View Full Code Here

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

                    final Attr attr = (Attr) exNode;
                    if (attr.getName().equals("file")) {
                        final Sequence seq = enviroment(XmldbURI.create(attr.getBaseURI()).removeLastSegment() + "/" + attr.getValue());
                        StringBuilder sb = new StringBuilder();
                        for (int j = 0; j < seq.getItemCount(); j++) {
                            sb.append(toString(seq.itemAt(j)));
                        }
                        exString = sb.toString();
                    } else if (attr.getName().equals("ignore-prefixes")) {
                        ignorePrefixes = Boolean.parseBoolean(attr.getValue());
                        exString = expected.item(++i).getNodeValue();
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()

            else {
            pos--;
            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.Sequence.itemAt()

              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.Sequence.itemAt()

        Item item = null;
        // 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, contextItem);
            if(!seq.isEmpty())
                {item = seq.itemAt(0);}
        } else {
          if (contextItem == null)
              {throw new XPathException(this, ErrorCodes.XPDY0002, "Undefined context item");}
          item = contextItem;
        }
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.