XsltVariable (boolean global) { final PsiReference reference = findInjectedReferenceAtCaret(); final PsiElement element = reference.resolve(); assertTrue(element instanceof XsltVariable); final XsltVariable var = (XsltVariable)element; assertEquals(var.getName(), ((XPathVariableReference)reference).getReferencedName()); assertEquals(global, XsltSupport.isTopLevelElement(var.getTag())); return var; }