Package org.exist.xquery.value

Examples of org.exist.xquery.value.AtomicValue.convertTo()


            while (iter.hasNext()) {
                item = iter.nextItem();
                value = item.atomize();
                //Any value of type xdt:untypedAtomic are cast to xs:double
                if (value.getType() == Type.UNTYPED_ATOMIC)
                    {value = value.convertTo(Type.DOUBLE);}
                if (!(value instanceof ComputableValue)) {
                    throw new XPathException(this, ErrorCodes.FORG0006, "" +
                        Type.getTypeName(value.getType()) + "(" + value +
                        ") can not be an operand in a sum", value);
                }
View Full Code Here


              } else
                {throw new XPathException(this, ErrorCodes.FORG0006, "Cannot compare " + Type.getTypeName(value.getType()), value);}

          //Any value of type xdt:untypedAtomic is cast to xs:double
            } else if (value.getType() == Type.UNTYPED_ATOMIC)
                  {value = value.convertTo(Type.DOUBLE);}
               
            if (min == null)
                    {min = value;}
                else {                 
                  if (Type.getCommonSuperType(min.getType(), value.getType()) == Type.ATOMIC) {
View Full Code Here

                    throw new XPathException(this, ErrorCodes.FORG0006, "Cannot compare " + Type.getTypeName(min.getType()) +
                        " and " + Type.getTypeName(value.getType()), value);
                  }
                    //Any value of type xdt:untypedAtomic is cast to xs:double
                    if (value.getType() == Type.ATOMIC)
                      {value = value.convertTo(Type.DOUBLE);}
                  //Numeric tests
                  if (Type.subTypeOf(value.getType(), Type.NUMBER)) {
                    //Don't mix comparisons
                    if (!Type.subTypeOf(min.getType(), Type.NUMBER))
                      {throw new XPathException(this, ErrorCodes.FORG0006, "Cannot compare " + Type.getTypeName(min.getType()) +
View Full Code Here

              } else
                {throw new XPathException(this, ErrorCodes.FORG0006, "Cannot compare " + Type.getTypeName(value.getType()), value);}

            //Any value of type xdt:untypedAtomic is cast to xs:double
            } else if (value.getType() == Type.UNTYPED_ATOMIC)
                  {value = value.convertTo(Type.DOUBLE);}
               
                if (max == null)
                    {max = value;}
               
                else {
View Full Code Here

                    throw new XPathException(this, ErrorCodes.FORG0006, "Cannot compare " + Type.getTypeName(max.getType()) +
                        " and " + Type.getTypeName(value.getType()), max);
                  }
                    //Any value of type xdt:untypedAtomic is cast to xs:double
                    if (value.getType() == Type.UNTYPED_ATOMIC)
                      {value = value.convertTo(Type.DOUBLE);}                 

                    //Numeric tests
                  if (Type.subTypeOf(value.getType(), Type.NUMBER)) {
                    //Don't mix comparisons
                    if (!Type.subTypeOf(max.getType(), Type.NUMBER))
View Full Code Here

            final SequenceIterator iter = inner.iterate();
            Item item = iter.nextItem();
            AtomicValue value = item.atomize();
            //Any values of type xdt:untypedAtomic are cast to xs:double
            if (value.getType() == Type.UNTYPED_ATOMIC)
                {value = value.convertTo(Type.DOUBLE);}
            if (!(value instanceof ComputableValue)) {
                throw new XPathException(this, ErrorCodes.FORG0006,
                    Type.getTypeName(value.getType()) + "(" + value + ") " +
                    "can not be an operand in a sum", value);
            }
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.