XSL - Does evaluating conditional expressions "shortcut"?
conditional-statements, xslt
Solution
Yes, it is called lazy-evaluation or short-circuiting, and xsl supports it. See: http://www.w3.org/TR/xpath#booleans
An and expression is evaluated by evaluating each operand and converting its value to a boolean as if by a call to the boolean function. The result is true if both values are true and false otherwise. The right operand is not evaluated if the left operand evaluates to false.
Problem
Given an XSL 'If' statement: ``` <xsl:if test="a = 'some value' and b = 'another value'"> ``` If `a` does not equal `'some value'`, is the value of `b` still checked? (As if the first test is `false`, the only outcome of the `and` is `false`.) This is what languages like C# do - I was wondering if the same goes in XSL. Does it depend on the engine/parser?