XSLT 1.0 Idiom for ternary if?
This Java program makes use of a Ternary if, to map booleans to output strings: (a "*" for true, an empty string for false). public class ternary { public static void main(String[] args) { boolean flags[]={true,false,true}; for (boolean f : flags) { System.out.println(f?"*":""); } } } So the output is *, [empty], *. I have an input XML document, something like: <?xml version="1.0" ?> <?xml-stylesheet type="text/xsl" href="change.xsl"?> <root> <change flag="true"/> <change flag="false"/> <change flag="true"/> </root> And I have the following XSLT template which maps true to '*' and false to ''