Expressions
Expressions are used to generate values based on matched expressions, header variables, properties, mappings and transforms.
The following substitutions are allowed in an expression:
- $number
- The last substring matched by group number number.
- $<name>
- The last substring matched by group named name matched by (?<name> ).
- ${property}
- The value of the property when the expression is evaluated.
- ${transform(value)}
- The result of calling the transform on the specified value.
- ${map:value}
- The result of mapping the specified value using the map. Replaced with empty string if no mapping exists.
- ${map:value|default}
- The result of mapping the specified value using the map. Replaced with the default if no mapping exists.
Substitutions can be nested. For example, the following rules will redirect to /WebForm1.aspx?q=this+was+upper+case.
<set property="transform-name" value="lower" />
<set property="value-to-transform" value="THIS WAS UPPER CASE" />
<redirect to="/WebForm1.aspx?q=${encode(${${transform-name}(
${value-to-transform})})}" />