This Element
This type of element allows you to only use certain rules if the specified conditions are met. This is useful for doing checks in shared XML files.
<If Type="Number" Value1="$(Level)" Operator="EqualTo" Value2="1">
<!-- Only execute the rules in this block if the "Level" variable is set to 1 -->
</If>
- Type: The type of the two values you're comparing.
- Boolean: The two values must be booleans (
true
/1
orfalse
/0
). - Number: The two values will be treated as numbers. For example,
1.0
would be equal to1
. - String: The two values will be treated as strings. For example,
1.0
is not equal to1
.
- Boolean: The two values must be booleans (
- Value1: The first value to compare.
- Operator: The operator with which to compare Value1 and Value2.
- EqualTo: True when the two values are equal.
- NotEqualTo: True when the two values are not equal.
- GreaterThan: True when Value1 is greater than Value2.
- Using this operator will force the
Type
to beNumber
.
- Using this operator will force the
- LessThan: True when Value1 is less than Value2.
- Using this operator will force the
Type
to beNumber
.
- Using this operator will force the
- GreaterThanOrEqualTo: True when Value1 is greater than or equal to Value2.
- Using this operator will force the
Type
to beNumber
.
- Using this operator will force the
- LessThanOrEqualTo: True when Value1 is less than or equal to Value2.
- Using this operator will force the
Type
to beNumber
.
- Using this operator will force the
- Value2: The second value to compare.
Child Elements
All elements valid at the location of the If
elements can be nested inside these elements.
Notes
This element can be inside all other elements.
Version History
1.0
Initial release.