private final SchemaProvider sp;
RELAXNSVerifier( SchemaProvider sp ) { this.sp=sp; }
public boolean verify( XMLReader p, InputSource instance, boolean panicMode ) throws Exception {
Dispatcher dispatcher = new DispatcherImpl(sp);
dispatcher.attachXMLReader(p);
ReportErrorHandler errorHandler = new ReportErrorHandler();
dispatcher.setErrorHandler( errorHandler );
// TODO: support the panicMode argument
p.parse(instance);
return !errorHandler.hadError;
}