private void validateRequiredExtensionAttributes(Element element, ISchemaElement schemaElement) {
    int severity = CompilerFlags.getFlag(fProject, CompilerFlags.P_NO_REQUIRED_ATT);
    if (severity == CompilerFlags.IGNORE) return;

    ISchemaAttribute[] attInfos = schemaElement.getAttributes();
    for (int i = 0; i < attInfos.length; i++) {
      ISchemaAttribute attInfo = attInfos[i];
      if (attInfo.getUse() == ISchemaAttribute.REQUIRED) {
        boolean found = element.getAttributeNode(attInfo.getName()) != null;
        if (!found && attInfo.getKind() == IMetaAttribute.JAVA) {
          NodeList children = element.getChildNodes();
          for (int j = 0; j < children.getLength(); j++) {
            if (attInfo.getName().equals(children.item(j).getNodeName())) {
              found = true;
              break;
            }
          }
        }
        if (!found) {
          reportMissingRequiredAttribute(element, attInfo.getName(), severity);
        }
      }
    }
  }