INTEGER expressions return integers (whole numbers). INTEGER expressions can be used to combine expressions, do arithmetic, and test conditions for conditional evaluation. The INTEGER AND expression evaluates one or more INTEGER expressions, returning 1 if all the sub-expressions return non-zero values, and otherwise returning 0.
The evaluation of sub-expressions stops as soon as one returns 0. INTEGER AND is the equivalent of the “&&” operator in Perl and C. Used in conjunction with an IF expression, an AND expression can check for more than one condition. The syntax requires one or more nested INTEGER expressions.
See the EXPRESSION element for DTD and attribute information.
This example uses an INTEGER AND expression to evaluate whether the records processed have a subject and sales rank property. If the records do not such properties, the REMOVE_RECORD deletes them.
<EXPRESSION TYPE="VOID" NAME="IF"> <EXPRESSION TYPE="INTEGER" NAME="AND"> <EXPRESSION TYPE="INTEGER" NAME="MATH"> <EXPRNODE NAME="TYPE" VALUE="INTEGER"/> <EXPRNODE NAME="OPERATOR" VALUE="EQUAL"/> <EXPRESSION TYPE="INTEGER" NAME="PROP_EXISTS"> <EXPRNODE NAME="PROP_NAME" VALUE="CATEGORY_ID"/> </EXPRESSION> <EXPRESSION TYPE="INTEGER" NAME="CONST"> <EXPRNODE NAME="VALUE" VALUE="0"/> </EXPRESSION> </EXPRESSION> <EXPRESSION TYPE="INTEGER" NAME="MATH"> <EXPRNODE NAME="TYPE" VALUE="INTEGER"/> <EXPRNODE NAME="OPERATOR" VALUE="EQUAL"/> <EXPRESSION TYPE="INTEGER" NAME="PROP_EXISTS"> <EXPRNODE NAME="PROP_NAME" VALUE="SALESRANK"/> </EXPRESSION> <EXPRESSION TYPE="INTEGER" NAME="CONST"> <EXPRNODE NAME="VALUE" VALUE="0"/> </EXPRESSION> </EXPRESSION> </EXPRESSION> <EXPRESSION TYPE="VOID" NAME="REMOVE_RECORD"/> </EXPRESSION>