boolean (Object element, PsiElement context) { if (!(element instanceof RncDocument)) { return false; } final PsiFile file = ((RncDocument)element).getContainingFile(); String namespace = null; if (file instanceof RncFile) { for (RncDecl decl : ((RncFile)file).getDeclarations()) { if (decl instanceof RncNsDecl) { namespace = decl.getDeclaredNamespace(); break; } } } if (namespace != null) { for (String aMyValue : myValue) { if (aMyValue.equals(namespace)) return true; } } return false; }