Object[] (XmlAttribute attribute) { final ModeReference.MyModeMatcher matcher = new ModeReference.MyModeMatcher(attribute, QNameUtil.ANY); final PsiElement[] modes = ResolveUtil.collect(matcher); final Collection<String> prefixes = XsltNamespaceContext.getPrefixes(attribute); final Set<NamespaceLookup> lookups = new HashSet<>(prefixes.size()); for (PsiElement mode : modes) { final QName qName = ((ImplicitModeElement)mode).getQName(); if (qName == null) continue; final String prefix = qName.getPrefix(); if (!prefixes.contains(prefix)) continue; lookups.add(new NamespaceLookup(prefix)); } return ArrayUtil.toObjectArray(lookups); }