Is there an “if -then – else ” statement in XPath?
Yes, there is a way to do it in XPath 1.0: concat( substring($s1, 1, number($condition) * string-length($s1)), substring($s2, 1, number(not($condition)) * string-length($s2)) ) This relies on the concatenation of two mutually exclusive strings, the first one being empty if the condition is false (0 * string-length(…)), the second one being empty if the condition is … Read more