boolean (XPathExpression expression) { expression = unparenthesize(expression); if (!(expression instanceof XPathFunctionCall call)) { return false; } if (call.getArgumentList().length != 1) { return false; } else if (call.getQName().getPrefix() != null) { XPathType type = call.getType(); if (type instanceof XPath2SequenceType) { type = ((XPath2SequenceType)type).getType(); } if (type instanceof XPath2Type) { final QName funcName = expression.getXPathContext().getQName(call); if (Comparing.equal(funcName, ((XPath2Type)type).getQName())) { return true; } } return false; } return XPathType.fromString(call.getFunctionName()) != XPathType.UNKNOWN; }