public @Nullable String getNamespacePrefix(PsiElement element) {
    if (element instanceof XmlAttribute attribute) {
      String prefix = attribute.getNamespacePrefix();
      if (!StringUtil.isEmpty(prefix)) {
        return prefix;
      }
    }
    final PsiElement tag = element instanceof XmlTag ? element : element.getParent();
    if (tag instanceof XmlTag) {
      return ((XmlTag)tag).getNamespacePrefix();
    } else {
      return null;
    }
  }
public @Nullable String getNamespacePrefix(PsiElement element)