!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);