PsiReference[] (String namespace, XmlAttributeValue value) { PsiReference[] references = value.getReferences(); for (int i = 0, referencesLength = references.length; i < referencesLength; i+=2) { PsiReference reference = references[i]; if (namespace.equals(getNamespaceFromReference(reference))) { if (i + 1 < referencesLength) { return new PsiReference[] { references[i + 1], reference }; } else { return new PsiReference[] { reference }; } } } return PsiReference.EMPTY_ARRAY; }