String id = Util.getParam(params, Params.ID, null);
final SchematronRepository repository = context.getBean(SchematronRepository.class);
Element result;
if (id == null) {
result = repository.findAllAsXml();
} else {
final Schematron one = repository.findOne(Integer.parseInt(id));
if (one == null) {
throw new BadParameterEx(Params.ID, id);
}