if (tldDigester.getFactory().getClass().getName().indexOf("xerces")!=-1) {
tldDigester = patchXerces(tldDigester);
}
// Set the schemaLocation
url = TldConfig.class.getResource(Constants.TldSchemaResourcePath_20);
SchemaResolver tldEntityResolver = new SchemaResolver(url.toString(),
tldDigester);
if (xmlValidation) {
if (tldDigester.getFactory().getClass()
.getName().indexOf("xerces")!=-1) {
try{
tldDigester.setFeature(
"http://apache.org/xml/features/validation/dynamic",
true);
tldDigester.setFeature(
"http://apache.org/xml/features/validation/schema",
true);
} catch(ParserConfigurationException e){
// log("contextConfig.registerLocalSchema", e);
} catch(SAXNotRecognizedException e){
// log("contextConfig.registerLocalSchema", e);
} catch(SAXNotSupportedException e){
// log("contextConfig.registerLocalSchema", e);
}
}
}
url = TldConfig.class.getResource(Constants.TldDtdResourcePath_11);
tldEntityResolver.register(Constants.TldDtdPublicId_11,
url.toString());
url = TldConfig.class.getResource(Constants.TldDtdResourcePath_12);
tldEntityResolver.register(Constants.TldDtdPublicId_12,
url.toString());
tldEntityResolver = registerLocalSchema(tldEntityResolver);
tldDigester.setEntityResolver(tldEntityResolver);