void (XmlTag tag,String schemaAttrName, String resolveFileName) { String attributeValue = tag.getAttributeValue(schemaAttrName); if (attributeValue != null) { XmlAttribute attribute = tag.getAttribute(schemaAttrName, null); PsiReference[] references = attribute.getValueElement().getReferences(); assertTrue( "There should resolvable reference to " + schemaAttrName, references.length > 0 ); for (PsiReference reference : references) { PsiElement element = reference.resolve(); if (element != null && element.getContainingFile().getName().equals(resolveFileName)) { return; } } assertTrue("There should resolvable reference to "+ schemaAttrName + ", 2", true); } }