XPathType () { final XPathType declaredType = XsltCodeInsightUtil.getDeclaredType(getTag()); if (declaredType != null) { return declaredType; } final XmlAttribute attr = getTag().getAttribute("type", XsltSupport.PLUGIN_EXTENSIONS_NS); if (attr != null) { return XPathType.fromString(attr.getValue()); } final XPathExpression value = getValue(); if (value instanceof XPathVariableReference reference) { // recursive reference <xsl:variable name="foo" select="$foo" /> if (reference.resolve() == this) { return XPathType.UNKNOWN; } } return value != null ? value.getType() : XPathType.UNKNOWN; }