if (grammar != null) {
XMLParserConfiguration config = domParser.getXMLParserConfiguration();
XMLComponent validatorComponent = null;
/** For Xerces grammars, use built-in schema validator. **/
if (grammar instanceof XSGrammarPoolContainer) {
validatorComponent = new XMLSchemaValidator();
fSchemaValidationManager = new ValidationManager();
XMLDTDFilter entityHandler = new UnparsedEntityHandler(fSchemaValidationManager);
config.setDTDHandler(entityHandler);
entityHandler.setDTDHandler(domParser);
domParser.setDTDSource(entityHandler);