test.run();
}
public void run() throws SaxonApiException {
Processor processor = new Processor(true);
SchemaManager manager = processor.getSchemaManager();
// No resolver here, there isn't one.
DocumentBuilder builder = processor.newDocumentBuilder();
SAXSource source = new SAXSource(new InputSource("http://tests.xproc.org/tests/doc/compoundEntity.xml"));
XdmNode document = builder.build(source);
source = new SAXSource(new InputSource("http://tests.xproc.org/tests/doc/document.xsd"));
XdmNode schema = builder.build(source);
manager.load(schema.asSource());
XdmDestination destination = new XdmDestination();
Controller controller = new Controller(processor.getUnderlyingConfiguration());
Receiver receiver = destination.getReceiver(controller.getConfiguration());
PipelineConfiguration pipe = controller.makePipelineConfiguration();
pipe.setRecoverFromValidationErrors(false);
receiver.setPipelineConfiguration(pipe);
SchemaValidator validator = manager.newSchemaValidator();
validator.setDestination(destination);
dumpTree(document, "Input");
validator.validate(document.asSource());