posted 8 years ago
"boolean" is a property. You can have a boolean constant, variable, or expression. The defining characteristic is simply that there are only 2 possible values, typically designated as True/False, Yes/No, Aye/Nay (this was actually an option on one OS I used!), or whatever.
The expression "a > b" is a boolean expression. It can only result in a true or false answer. That's as opposed to, say, "a - b", which can result in any number of numerical answers.
Thus, the expression "if (b > a) = true" is redundant, since if b is greater than a, the result of that sub-expression is going to be true, reducing the equation to "if true = true", which is a tautology.
In XML - including XSL - there is a "gotcha", as Liutauras has observed and that's that the less-than and greater-than operators have ambiguous meanings in XML, since those characters are also part of the XML "magic character" set (< > & " ) and therefore should be represented in a way that doesn't confuse the XML parser, such as:
Which I had to edit a couple of times since it also confused the CodeRanch message parser!
Or, I believe:
The first case being the literal "a > b" expressed via XML entity escaping, the second one using an expression language operator - which is easier to type and to read. Assuming that XSL honors that notation and I didn't just mis-remember it from its use in EL.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.