Package org.exist.xquery.value

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


                    "left item is not a node; got '" +
                    Type.getTypeName(ls.itemAt(0).getType()) + "'");}
            if (!Type.subTypeOf(rs.itemAt(0).getType(), Type.NODE))
                {throw new XPathException(this, ErrorCodes.XPTY0004,
                    "right item is not a node; got '" +
                    Type.getTypeName(rs.itemAt(0).getType()) + "'");}
            final NodeValue lv = (NodeValue)ls.itemAt(0);
            final NodeValue rv = (NodeValue)rs.itemAt(0);
            if (lv.getImplementationType() != rv.getImplementationType()) {
                // different implementations : can't be the same nodes
                result =  BooleanValue.FALSE;
View Full Code Here


            if (!Type.subTypeOf(rs.itemAt(0).getType(), Type.NODE))
                {throw new XPathException(this, ErrorCodes.XPTY0004,
                    "right item is not a node; got '" +
                    Type.getTypeName(rs.itemAt(0).getType()) + "'");}
            final NodeValue lv = (NodeValue)ls.itemAt(0);
            final NodeValue rv = (NodeValue)rs.itemAt(0);
            if (lv.getImplementationType() != rv.getImplementationType()) {
                // different implementations : can't be the same nodes
                result =  BooleanValue.FALSE;
            } else {
                switch(relation) {
View Full Code Here

              startSeq.itemAt(0).getStringValue() + ")'", startSeq);
            }
            NumericValue valueEnd;
            try {
              //Currently breaks 3 to 1e3
              valueEnd = (NumericValue)endSeq.itemAt(0).convertTo(Type.NUMBER);
            } catch (final XPathException e) {
          throw new XPathException(this, ErrorCodes.FORG0006, "Required type is " +
              Type.getTypeName(Type.INTEGER) + " but got '" + Type.getTypeName(endSeq.itemAt(0).getType()) + "(" +
              endSeq.itemAt(0).getStringValue() + ")'", endSeq);
            }
View Full Code Here

            try {
              //Currently breaks 3 to 1e3
              valueEnd = (NumericValue)endSeq.itemAt(0).convertTo(Type.NUMBER);
            } catch (final XPathException e) {
          throw new XPathException(this, ErrorCodes.FORG0006, "Required type is " +
              Type.getTypeName(Type.INTEGER) + " but got '" + Type.getTypeName(endSeq.itemAt(0).getType()) + "(" +
              endSeq.itemAt(0).getStringValue() + ")'", endSeq);
            }
            //Implied by previous conversion
            if (valueStart.hasFractionalPart()) {
          throw new XPathException(this, ErrorCodes.FORG0006, "Required type is " +
View Full Code Here

              //Currently breaks 3 to 1e3
              valueEnd = (NumericValue)endSeq.itemAt(0).convertTo(Type.NUMBER);
            } catch (final XPathException e) {
          throw new XPathException(this, ErrorCodes.FORG0006, "Required type is " +
              Type.getTypeName(Type.INTEGER) + " but got '" + Type.getTypeName(endSeq.itemAt(0).getType()) + "(" +
              endSeq.itemAt(0).getStringValue() + ")'", endSeq);
            }
            //Implied by previous conversion
            if (valueStart.hasFractionalPart()) {
          throw new XPathException(this, ErrorCodes.FORG0006, "Required type is " +
              Type.getTypeName(Type.INTEGER) + " but got '" + Type.getTypeName(startSeq.itemAt(0).getType()) + "(" +
View Full Code Here

              startSeq.itemAt(0).getStringValue() + ")'", startSeq);
        }
            //Implied by previous conversion
            if (valueEnd.hasFractionalPart()) {
          throw new XPathException(this, ErrorCodes.FORG0006, "Required type is " +
              Type.getTypeName(Type.INTEGER) + " but got '" + Type.getTypeName(endSeq.itemAt(0).getType()) + "(" +
              startSeq.itemAt(0).getStringValue() + ")'", endSeq);
            }         
//            result = new ValueSequence();
//        for(long i = ((IntegerValue)valueStart.convertTo(Type.INTEGER)).getLong();
//          i <= ((IntegerValue)valueEnd.convertTo(Type.INTEGER)).getLong(); i++) {
View Full Code Here

              !Type.subTypeOf(startSeq.itemAt(0).atomize().getType(), Type.UNTYPED_ATOMIC))
          {throw new XPathException(this, ErrorCodes.FORG0006, "Required type is " +
              Type.getTypeName(Type.INTEGER) + " but got '" + Type.getTypeName(startSeq.itemAt(0).getType()) + "(" +
              startSeq.itemAt(0).getStringValue() + ")'", startSeq);}
            //Quite unusual test : we accept integers but no other *typed* type
            if (!Type.subTypeOf(endSeq.itemAt(0).atomize().getType(), Type.INTEGER) &&
              !Type.subTypeOf(endSeq.itemAt(0).atomize().getType(), Type.UNTYPED_ATOMIC))
          {throw new XPathException(this, ErrorCodes.FORG0006, "Required type is " +
              Type.getTypeName(Type.INTEGER) + " but got '" + Type.getTypeName(endSeq.itemAt(0).getType()) + "(" +
              endSeq.itemAt(0).getStringValue() + ")'", endSeq);}
            final IntegerValue valueStart = (IntegerValue)startSeq.itemAt(0).convertTo(Type.INTEGER);
View Full Code Here

          {throw new XPathException(this, ErrorCodes.FORG0006, "Required type is " +
              Type.getTypeName(Type.INTEGER) + " but got '" + Type.getTypeName(startSeq.itemAt(0).getType()) + "(" +
              startSeq.itemAt(0).getStringValue() + ")'", startSeq);}
            //Quite unusual test : we accept integers but no other *typed* type
            if (!Type.subTypeOf(endSeq.itemAt(0).atomize().getType(), Type.INTEGER) &&
              !Type.subTypeOf(endSeq.itemAt(0).atomize().getType(), Type.UNTYPED_ATOMIC))
          {throw new XPathException(this, ErrorCodes.FORG0006, "Required type is " +
              Type.getTypeName(Type.INTEGER) + " but got '" + Type.getTypeName(endSeq.itemAt(0).getType()) + "(" +
              endSeq.itemAt(0).getStringValue() + ")'", endSeq);}
            final IntegerValue valueStart = (IntegerValue)startSeq.itemAt(0).convertTo(Type.INTEGER);
            final IntegerValue valueEnd = (IntegerValue)endSeq.itemAt(0).convertTo(Type.INTEGER);
View Full Code Here

              startSeq.itemAt(0).getStringValue() + ")'", startSeq);}
            //Quite unusual test : we accept integers but no other *typed* type
            if (!Type.subTypeOf(endSeq.itemAt(0).atomize().getType(), Type.INTEGER) &&
              !Type.subTypeOf(endSeq.itemAt(0).atomize().getType(), Type.UNTYPED_ATOMIC))
          {throw new XPathException(this, ErrorCodes.FORG0006, "Required type is " +
              Type.getTypeName(Type.INTEGER) + " but got '" + Type.getTypeName(endSeq.itemAt(0).getType()) + "(" +
              endSeq.itemAt(0).getStringValue() + ")'", endSeq);}
            final IntegerValue valueStart = (IntegerValue)startSeq.itemAt(0).convertTo(Type.INTEGER);
            final IntegerValue valueEnd = (IntegerValue)endSeq.itemAt(0).convertTo(Type.INTEGER);
//             result = new ValueSequence();
//        for (long i = valueStart.getLong();  i <= valueEnd.getLong(); i++) {
View Full Code Here

            //Quite unusual test : we accept integers but no other *typed* type
            if (!Type.subTypeOf(endSeq.itemAt(0).atomize().getType(), Type.INTEGER) &&
              !Type.subTypeOf(endSeq.itemAt(0).atomize().getType(), Type.UNTYPED_ATOMIC))
          {throw new XPathException(this, ErrorCodes.FORG0006, "Required type is " +
              Type.getTypeName(Type.INTEGER) + " but got '" + Type.getTypeName(endSeq.itemAt(0).getType()) + "(" +
              endSeq.itemAt(0).getStringValue() + ")'", endSeq);}
            final IntegerValue valueStart = (IntegerValue)startSeq.itemAt(0).convertTo(Type.INTEGER);
            final IntegerValue valueEnd = (IntegerValue)endSeq.itemAt(0).convertTo(Type.INTEGER);
//             result = new ValueSequence();
//        for (long i = valueStart.getLong();  i <= valueEnd.getLong(); i++) {
//          result.add(new IntegerValue(i));
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.