mapBuilder.put(ValidateProperty.RESOLVER,
BasicResolver.getInstance());
mapBuilder.put(ValidateProperty.ERROR_HANDLER,
new ErrorHandlerImpl());
SchemaReader schemaReader;
if (schemaName.endsWith(".rnc"))
{
schemaReader = CompactSchemaReader.getInstance();
} else if (schemaName.endsWith(".sch")) {
schemaReader = new AutoSchemaReader(
new SchemaReaderFactorySchemaReceiverFactory(
new ExtendedSaxonSchemaReaderFactory()));
}
else
{
schemaReader = new AutoSchemaReader();
}
schema = schemaReader.createSchema(schemaSource,
mapBuilder.toPropertyMap());
}
catch (RuntimeException e)
{
throw e;