Web.config XML Transformation with escape character

Viewed 437

My ASP.net application has web.config with this appSettings key.

<add key="XmlTag" value="Test"/>

And the value i want to transform has "greater than' sign i.e.

<add key="XmlTag" value=">~NewValue" xdt:Transform="Replace" xdt:Locator="Match(key)"/>

When the value gets transformed it transforms value to

<add key="XmlTag" value="&gt;~NewValue"/>

This is the same case if i escape the "greater than' sign in the web.config.

<add key="XmlTag" value="&gt;~NewValue" xdt:Transform="Replace" xdt:Locator="Match(key)"/>

Here is tranformation preview using SlowCheetah in Visual Studio.

Web.config

Web.config

Web.Qa.config: Web.QA.config

Preview of Transform:

Web.config Preview Transform

What do i do in my transformation configuration file so that when the file gets transformed, it adds the "greater than" sign?

0 Answers
Related