Skip to content

TernaryOperator

Phil Shafer edited this page Jul 9, 2013 · 2 revisions

The Ternary Operator ("?:") in SLAX

As the last touch to SLAX-1.1, I've added the ternary operator from C, allowing expressions like:

var $a = $b ? $c : $d;
var $e = $f ?: $g;

The caveat is that this uses an extension function slax:value() which may not be available in all XSLT environments. Coders must consider whether should a restriction deems this operator unusable. Portability considerations are identical to mutable variables (mvars).

Clone this wiki locally