if (contentType != null) {
compact |= contentType.startsWith("text/") || contentType.equals("application/relax-ng-compact-syntax");
}
InputSource schemaInputSource = null;
JingConfigurer configurer = runtime.getConfigurer().getJingConfigurer();
if (compact) {
// Compact syntax
configurer.configRNC(properties);
sr = CompactSchemaReader.getInstance();
// Grotesque hack!
StringReader srdr = new StringReader(compactSchema(root));
schemaInputSource = new InputSource(srdr);
schemaInputSource.setSystemId(root.getBaseURI().toASCIIString());
} else {
// XML syntax
configurer.configRNG(properties);
sr = new AutoSchemaReader();
schemaInputSource = S9apiUtils.xdmToInputSource(runtime, schema);
}
ValidationDriver driver = new ValidationDriver(properties.toPropertyMap(), sr);