INTEGER
expressions return integers (whole
numbers).
INTEGER
expressions can be used to combine expressions, do
arithmetic, and test conditions for conditional evaluation. The
INTEGER PROP_EXISTS
expression checks for a specified
property on each record being processed.
The name of the property is specified in a
PROP_NAME
expression node. The expression returns the
number of values of the property on each record. For example, if a record has
three values from the “Color” property, the
PROP_EXISTS
expression would return 3. If the record
has no values for the “Color” property, it would return 0.
INTEGER
PROP_EXISTS
is useful as the condition expression in a
VOID IF expression.
See the
EXPRESSION
element for DTD and attribute information.
As part of an
INTEGER AND
expression, this example uses two
INTEGER PROP_EXISTS
sub-expressions to test whether
the specified
PROP_NAME
exists.
<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>