XPath evaluation: cannot handle function 'if'

The if() function requires 3 arguments

if(expression, then, else)
if(    1,        2,    3 )

and your calculation for your question with name = split_direct has too many arguments for the final if() operator:

2 Likes