Skip to content

Instantly share code, notes, and snippets.

@sayedihashimi
Created March 17, 2015 17:42
Show Gist options
  • Save sayedihashimi/581878c375db22eabd22 to your computer and use it in GitHub Desktop.
Save sayedihashimi/581878c375db22eabd22 to your computer and use it in GitHub Desktop.
XDT Transform samples
<configuration>
<connectionStrings>
<clear/>
<add name="Default" connectionString="Data Source=localhost;Initial Catalog=Sample01;Integrated Security=True;" />
</connectionStrings>
<appSettings>
<add key="contactEmail" value="contact@demo.example.com"/>
<add key="siteUrl" value="http://demo.example.com"/>
</appSettings>
</configuration>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<connectionStrings>
<clear/>
<add name="Default" connectionString="Data Source=NOT-localhost;Initial Catalog=Sample01;Integrated Security=True;"
xdt:Locator="Match(name)" xdt:Transform="Replace"/>
</connectionStrings>
<appSettings>
<add key="contactEmail" value="contact@example.com" xdt:Locator="Match(key)" xdt:Transform="Replace"/>
<add key="siteUrl" value="http://example.com" xdt:Locator="Match(key)" xdt:Transform="Replace"/>
</appSettings>
</configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment