protected void endSelf()
{// wrap-up.
final RELAXNSReader reader = (RELAXNSReader)this.reader;
SchemaProviderImpl schemaProvider = new SchemaProviderImpl(reader.grammar);
reader.schemaProvider = schemaProvider;
if(!reader.controller.hadError()) {
// abort further wrap up if there was an error.
// then bind it as the final wrap-up.
if( !schemaProvider.bind(reader.controller) )
reader.controller.setErrorFlag();
// also bind top-level expression
if( reader.grammar.topLevel!=null )
// this 'if' clause is necessary when