Move some validations into the RELAX NG grammar.