Use & in '@(...)' Expressions

Q

How to enter & entity in '@(...)' expressions?

✍: FYIcenter.com

A

If you want to enter the & sequence in a '@(...)' expressions, you must enter it as &.

This is because all XML entities will be decoded immediately, when Azure process the policy XML document.

For example, the following "set-variable" policy statement uses a "@(...)" expression that contains the & entity:

<set-variable name="entity" value="@("& = &amp;amp;")" />

The above statement will set "& = &amp;" into the "entity" variable.

The same logic is true for all other XML entities:

< and &lt; give the same result in @(...)
> and &gt; give the same result in @(...)
& and &amp; give the same result in @(...)

 

Using Azure API Policy

⇒⇒Microsoft Azure API Management Tutorials

2017-11-12, 126👍, 0💬