private void validateExistingExtensionAttributes(Element element, NamedNodeMap attrs, ISchemaElement schemaElement) {
for (int i = 0; i < attrs.getLength(); i++) {
Attr attr = (Attr) attrs.item(i);
ISchemaAttribute attInfo = schemaElement.getAttribute(attr.getName());
if (attInfo == null) {
HashSet<String> allowedElements = new HashSet<>();
computeAllowedElements(schemaElement.getType(), allowedElements);
if (allowedElements.contains(attr.getName())) {
validateJavaAttribute(element, attr);
} else {
int flag = CompilerFlags.getFlag(fProject, CompilerFlags.P_UNKNOWN_ATTRIBUTE);
if (flag != CompilerFlags.IGNORE)
reportUnknownAttribute(element, attr.getName(), flag);
}
} else {
validateExtensionAttribute(element, attr, attInfo);
}
}
}