doctrine of substantial compliance — Legal Definition, Examples & Cases