boolean (@NotNull PsiElement context) { PsiFile containingFile = context.getContainingFile(); if (containingFile instanceof XPathFile) { final XmlFile xmlFile = PsiTreeUtil.getContextOfType(containingFile, XmlFile.class); if (xmlFile != null && XsltSupport.isXsltFile(xmlFile)) { return true; } } return false; }