public static @Nullable DomTarget getTarget(DomElement element, GenericDomValue nameElement) {
    if (nameElement instanceof GenericAttributeValue genericAttributeValue) {
      final XmlAttributeValue attributeValue = genericAttributeValue.getXmlAttributeValue();
      if (attributeValue == null) {
        return null;
      }

      final int length = attributeValue.getTextLength();
      if (length >= 2) {
        return new DomTarget(element, attributeValue, new TextRange(1, length - 1), nameElement);
      }
    }

    final XmlTag tag = nameElement.getXmlTag();
    if (tag == null) {
      return null;
    }

    XmlTagValue tagValue = tag.getValue();
    if (StringUtil.isEmpty(tagValue.getTrimmedText())) {
      return null;
    }

    return new DomTarget(element, tag, XmlTagUtil.getTrimmedValueRange(tag), nameElement);
  }
public static @Nullable DomTarget getTarget(DomElement element, GenericDomValue nameElement)