  In this work we treat realization results for operator-valued functions which
are analytic in the complex sense or slice hyperholomorphic over the
quaternions. In the complex setting, we prove a realization theorem for an
operator-valued function analytic in a neighborhood of the origin with a
coisometric state space operator thus generalizing an analogous result in the
unitary case. A main difference with previous works is the use of reproducing
kernel Krein spaces. We then prove the counterpart of this result in the
quaternionic setting. The present work is the first paper which presents a
realization theorem with a state space which is a quaternionic Krein space
