toString(), Type.getTypeName(type.getPrimaryType()), Type.getTypeName(requiredType)));
toString(), Type.getTypeName(value.getItemType()), Type.getTypeName(requiredType)));
    public void checkType() throws XPathException {        if (type == null)            return;        type.checkCardinality(value);                if (value.getLength() == 0)            return;                int requiredType = type.getPrimaryType();        if(Type.subTypeOf(requiredType, Type.ATOMIC)) {            if(!Type.subTypeOf(value.getItemType(), Type.ATOMIC))                value = Atomize.atomize(value);            if(requiredType != Type.ATOMIC)                value = convert(value);        }        if(!Type.subTypeOf(value.getItemType(), requiredType))            throw new XPathException(Messages.getMessage(Error.VAR_TYPE_MISMATCH,                    toString(), Type.getTypeName(type.getPrimaryType()), Type.getTypeName(requiredType)));    }