title: web.config xpath transform - find by parent element
body: <p>I am trying to change a log file name after deploying, so transform this:</p>
  
  <pre><code>&lt;log4net&gt;
      ...
      &lt;appender name="GeneralAppender" type="log4net.Appender.RollingFileAppender, log4net"&gt;
          &lt;file value="c:\logs\Co.App.log" /&gt;
      ...
      &lt;/appender&gt;
  &lt;/log4net&gt;
  </code></pre>
  
  <p>to this:</p>
  
  <pre><code>&lt;log4net&gt;
      ...
      &lt;appender name="GeneralAppender" type="log4net.Appender.RollingFileAppender, log4net"&gt;
          &lt;file value="c:\logs\Co.App.localhost.log" /&gt;
      ...
      &lt;/appender&gt;
  &lt;/log4net&gt;
  </code></pre>
  
  <p>the actual <strong>file</strong> node doesn't have any attributes, so I am trying to locate it by parent node</p>
  
  <pre><code>  &lt;runtime&gt;
      &lt;assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"&gt;
        &lt;log4net&gt;
          &lt;appender &gt;
            &lt;file value="c:\logs\Co.App.localhost.log" xdt:Transform="Replace" xdt:Locator="XPath(../appender[@name='GeneralAppender'])" /&gt;
          &lt;/appender&gt;
        &lt;/log4net&gt;
      &lt;/assemblyBinding&gt;
    &lt;/runtime&gt;
  </code></pre>
  
  <p>i've also tried all permutations of absolute and relative xpath's but i don't see it having any effect in transform preview. </p>
  
  <p>i tried: </p>
  
  <blockquote>
    <p>xdt:Locator="XPath(//appender[@name='GeneralAppender']/file)"</p>
  </blockquote>
  
  <p>and even:</p>
  
  <blockquote>
    <p>xdt:Transform="Remove" xdt:Locator="XPath(//file)"</p>
  </blockquote>