The use of polynomial splines as a basis for the interpolation of discrete data can be theoretically justified by a minimum principle. It is natural to apply this principle also if shape preserving is added as a constraint, although the construction process is then nonlinear. We discuss two algorithms for the construction of the cubic spline interpolant under the constraint of positivity or monotonicity, and give a detailed convergence analysis. Numerical tests illustrate that analysis.