Receiver receiver = destination.getReceiver(controller.getConfiguration());
PipelineConfiguration pipe = controller.makePipelineConfiguration();
pipe.setRecoverFromValidationErrors(!getOption(_assert_valid,false));
receiver.setPipelineConfiguration(pipe);
SchemaValidator validator = manager.newSchemaValidator();
validator.setDestination(destination);
validator.setErrorListener(new XSDErrorHandler());
String mode = getOption(_mode, "strict");
validator.setLax("lax".equals(mode));
boolean useHints = getOption(_use_location_hints, false);
validator.setUseXsiSchemaLocation(useHints);
try {
logger.trace(MessageFormatter.nodeMessage(step.getNode(),
"Validating: " + doc.getBaseURI().toASCIIString()));
validator.validate(doc.asSource());
if (validationException != null) {
throw (SaxonApiException) validationException;
}
} catch (SaxonApiException sae) {
if (getOption(_assert_valid,false)) {