PsiReference[] (final XmlElement element, @NotNull String text) { if (element.getContainingFile() instanceof HtmlCompatibleFile) { return new PsiReference[]{new HtmlEnumeratedValueReference(element, this, null) { @Nullable @Override public PsiElement resolve() { if (isTokenDatatype(getValue())) { return getElement(); } return super.resolve(); } }}; } else { return new PsiReference[]{new XmlEnumeratedValueReference(element, this) { @Nullable @Override public PsiElement resolve() { if (isTokenDatatype(getValue())) { return getElement(); } return super.resolve(); } }}; } }