ZPT-JS reference - Boolean expressions

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:

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>