boolean isXMLJSP = isXMLJSP(document);
boolean hasHTMLFeature = hasHTMLFeature(document);
if (hasHTMLFeature && !isXMLJSP) {
INodeAdapterFactory factory = HTMLValidationAdapterFactory.getInstance();
ValidationAdapter adapter = (ValidationAdapter) factory.adapt(document);
if (adapter != null) {
HTMLValidationReporter rep = getReporter(reporter, file, model);
rep.clear();
adapter.setReporter(rep);
adapter.validate(document);
}
}
if (!hasHTMLFeature && isXMLJSP) {
Validator xmlValidator = new Validator();
xmlValidator.validate(file, kind, state, monitor);