|
|||||
Precedence of logical operators | |||||
The precedence of logical operators in order from highest to lowest is:
not
has precedence over the rest because unary operators always have precedence over binary operators.
Parentheses can be used to override these precedences.
This example illustrates the precedence of logical operators.
The condition is true either if an explicit value for the attribute "docno" occurs in the document, or if both the value of the counter "chapno" is greater than 1 and the stream "xref" is not open.
local counter chapno local stream xref ... when attribute docno is specified or chapno > 1 and not xref is open
In this example, parentheses are used to override the precedence of logical operators. The condition is true if, and only if, "xref" is not open and either "docno" is specified for the current element or "chapno" is larger than 1.
local counter chapno local stream xref ... when (attribute docno is specified or chapno > 1) and not xref is open
---- |