title: Web.config Transform variables
body: <p>Is it possible to include variables in a web.config transform file? For each environment, I have basically the same transform, just with different values.  For example, for the development environment, I'd have...</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"&gt;
      &lt;appSettings&gt;
          &lt;add key="serverName" value="server1" xdt:Transform="Replace" xdt:Locator="Match(key)" /&gt;
          &lt;add key="serverPath" value="\\server1" xdt:Transform="Replace" xdt:Locator="Match(key)" /&gt;
      &lt;/appSettings&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>And for the QA environment, I'd have...</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"&gt;
      &lt;appSettings&gt;
          &lt;add key="serverName" value="server2" xdt:Transform="Replace" xdt:Locator="Match(key)" /&gt;
          &lt;add key="serverPath" value="\\server2" xdt:Transform="Replace" xdt:Locator="Match(key)" /&gt;
      &lt;/appSettings&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>The only difference is the value for server1 vs server2.  This is a simple example, and in reality, I use the server value multiple times in the transform.  Is there any way to declare a variable in the transform file to be used multiple times?  Something like...</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"&gt;
      &lt;property name="server" value="server2" /&gt;
      &lt;appSettings&gt;
          &lt;add key="serverName" value="${server}" xdt:Transform="Replace" xdt:Locator="Match(key)" /&gt;
          &lt;add key="serverPath" value="\\${server}" xdt:Transform="Replace" xdt:Locator="Match(key)" /&gt;
      &lt;/appSettings&gt;
  &lt;/configuration&gt;
  </code></pre>