Recognized Functions inside the expression part of the ‘if’ command
Type | Functions | Recognized operators in the expression | |||
String | string() | + | plus | ||
concat() | - | minus | |||
starts-with() | = | Equal | |||
contains() | != | Not Equal | |||
substring-before() | < | less than | |||
substring-after() | <= | less than or equal to | |||
substring() | > | greater than | |||
string-length() | >= | greater than or equal to | |||
normalize-space() | |||||
translate() | |||||
Boolean | boolean() | ||||
not() | and | boolean and | |||
true() | or | boolean or | |||
false() | |||||
lang() | |||||
Number | number() | ||||
sum() | |||||
floor() | |||||
ceiling() | |||||
round() |
Examples:
"{Location}"!=concat("Toro","nto") and string-length("{Location}")>5
translate('{Location}','ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')='toronto'
NEW if and select statements can be used in paragaraph command
if statement Syntax !!if condition%%string if true%%string if false!!
Example !!if "{City}"="Toronto"%%Toronto is returned%%Not Correct!!
select statement Syntax !!select value%%"value1"##string if value=value1%%"value1"##string if value=value1%%"value1"##string if value=value1!!
or
!!select value %% value1 ## return string if value=value1
%% value2 ## return string if value=value2
%% value3 ## return string if value=value3
!!
Example !!select "{Colour}"%%"Red"##Selected Colour is Dark Red%%"White"##Selected Colour is Bright White%%"Green"##Selected Colour isForest Green!!
NEW (March 15, 2011) true and false statements are now evaluated for regular expressions for both if and select commands
Example !!if"{Email}"!=""%%concat("Name:",substring-before("{Email}","@")," Domain:",substring-after("{Email}","@"))%%Nothing!!
if Email was tester@test.com then the output would be
Name: tester Domain: test.com
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article