Syntax
or and and syntax:
or_and_expressions ::= ( 'or:' | 'and:' ) expression expression [ expression ]*
cond syntax:
cond_expressions ::= 'cond:' expression expression expression
not syntax:
not_expressions ::= 'not:' expression
Description
The list of available boolean expressions is:
or: x y
-> boolean or of expressions x and yand: x y
-> boolean and of expressions x and ycond: x y z
-> evaluate as boolean x; if true return y, otherwise return znot: x
-> if x then false else true
All operators uses lazy evaluation. or and and expressions support 2 or more operators. cond expressions only support 3. not expressions only support 1. Parenthesis can be used.
Differences with ZPT
This expressions does not exist in ZPT.
Examples
Some examples in data-condition and data-content:
<p data-condition="or: isFridayNight isSaturday isSunday"> Yeah! </p> <p data-condition="and: ( exists:pets()/dog() ) ( not:pets()/dog()/badDog() )"> Good dog! </p> <p data-content="cond: partyToday 'Yeah!' 'Oh!'"> Party? </p>