boolean (final PsiElement element) { if (element instanceof XmlTag) { final XmlTag simpleContent = XmlUtil.getSchemaSimpleContent((XmlTag)element); if (simpleContent != null && XmlUtil.collectEnumerationValues(simpleContent, new HashSet<>())) { return true; } } if (element instanceof XmlAttributeValue) { final PsiElement parent = element.getParent(); if (parent instanceof XmlAttribute) { final XmlAttributeDescriptor descriptor = ((XmlAttribute)parent).getDescriptor(); if (descriptor != null && descriptor.isEnumerated()) { return true; } String[] enumeratedValues = XmlAttributeValueGetter.getEnumeratedValues((XmlAttribute)parent); if (enumeratedValues.length > 0) { String value = descriptor == null ? null : descriptor.getDefaultValue(); if (value == null || enumeratedValues.length != 1 || !value.equals(enumeratedValues[0])) { return true; } } } } return false; }