Examples of itemAt()


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

    if(ls.isEmpty() || rs.isEmpty())
      {return Sequence.EMPTY_SEQUENCE;}
    if (ls.hasOne() && rs.hasOne()) {
            AtomicValue lv, rv;
      lv = ls.itemAt(0).atomize();
      rv = rs.itemAt(0).atomize();
            final Collator collator = getCollator(contextSequence);
      return BooleanValue.valueOf(compareAtomic(collator, lv, rv, Constants.TRUNC_NONE, relation));
    }
        throw new XPathException(this, "Type error: sequence with more than one item is not allowed here");
  }
View Full Code Here

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

                    final AtomicValue lv = current.atomize();
                    final Sequence rs = getRight().eval(context.getNode().toSequence());                   
                    if (!rs.hasOne())
                        {throw new XPathException(this,
                                "Type error: sequence with less or more than one item is not allowed here");}                   
                    if (compareAtomic(collator, lv, rs.itemAt(0).atomize(), Constants.TRUNC_NONE, relation))
                        {result.add(current);}
                } while ((context = context.getNextDirect()) != null);
            }
        } else {
            final Sequence rs = getRight().eval(null);
View Full Code Here

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

        } else {
            final Sequence rs = getRight().eval(null);
            if (!rs.hasOne())
                {throw new XPathException(this,
                        "Type error: sequence with less or more than one item is not allowed here");}
            final AtomicValue rv = rs.itemAt(0).atomize();
            for (final Iterator<NodeProxy> i = nodes.iterator(); i.hasNext();) {
                final NodeProxy current = i.next();
                final AtomicValue lv = current.atomize();
                if (compareAtomic(collator, lv, rv, Constants.TRUNC_NONE, Constants.EQ))
                    {result.add(current);}
View Full Code Here

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

            // create the element
            final Sequence qnameSeq = qnameExpr.eval(contextSequence, contextItem);
            if(!qnameSeq.hasOne())
              {throw new XPathException(this, ErrorCodes.XPTY0004, "Type error: the node name should evaluate to a single item");}
            final Item qnitem = qnameSeq.itemAt(0);
            QName qn;
            if (qnitem instanceof QNameValue) {
                qn = ((QNameValue)qnitem).getQName();
            } else {
                //Do we have the same result than Atomize there ? -pb
View Full Code Here

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

        XQuery xqs = broker.getXQueryService();
       
        Sequence results = xqs.execute(query, null, AccessContext.TEST);

        if (! results.isEmpty()) {
            String catalog = (String) results.itemAt(0).getStringValue();
            catalog = "XQTS_"+adoptString(catalog);
            File subfolder = new File(folder.getAbsolutePath()+sep+catalog);
            processGroups(null, subfolder, "."+catalog);
        }
    }
View Full Code Here

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

                    first = false;
                allTests.write("\t\tC_"+adoptString(parentName)+".class");
            }

            for (int i = 0; i < results.getItemCount(); i++) {
                String groupName = results.itemAt(i).getStringValue();
                subfolder = new File(folder.getAbsolutePath()+sep+groupName);
                subPackage = _package_+"."+adoptString(groupName);

                if (processGroups(groupName, subfolder, subPackage)) {
                    if (!first)
View Full Code Here

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

                "import org.junit.Test;\n\n" +
                "public class C_"+adoptString(testGroup)+" extends XQTS_case {\n" +
                "\tprivate String testGroup = \""+testGroup+"\";\n\n");

            for (int i = 0; i < results.getItemCount(); i++) {
                String caseName = results.itemAt(i).getStringValue();
                out.write("\t/* "+caseName+" */" +
                    "\t@Test\n" +
                    "\tpublic void test_"+adoptString(caseName)+"() {\n" +
                    "\tgroupCase(testGroup, \""+caseName+"\");"+
                    "\t}\n\n");
View Full Code Here

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

    Sequence result;
    if (args.length == 0 || args[0].isEmpty()) {
      result = Sequence.EMPTY_SEQUENCE;
    } else {
      final Sequence arg = args[0];
      final DurationValue duration = new DurationValue(((DurationValue) arg.itemAt(0)).getCanonicalDuration());
      if (isCalledAs("days-from-duration")) {
            result = new IntegerValue(duration.getPart(DurationValue.DAY));
      } else if (isCalledAs("hours-from-duration")) {
            result = new IntegerValue(duration.getPart(DurationValue.HOUR));
      } else if (isCalledAs("minutes-from-duration")) {
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);
            if (!Type.subTypeOf(item.getType(), Type.NODE))
              {throw new XPathException(this, ErrorCodes.XPTY0004, "item is not a node; got '" + Type.getTypeName(item.getType()) + "'");}
            //TODO : how to improve performance ?
            final Node n = ((NodeValue)item).getNode();
            //Returns an expanded-QName for node kinds that can have names.
View Full Code Here

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

                final Sequence nodes = getArgument(1).eval(contextSequence);
                if (nodes.isEmpty()) {
                    logger.error(ErrorCodes.XPDY0002 + " No node or context item for fn:id");
                    throw new XPathException(this, ErrorCodes.XPDY0002, "XPDY0002: no node or context item for fn:id", nodes);
                }
                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)
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.