title: xslt transformation not working for wix installer window service
body: <p>**</p>
  
  <blockquote>
    <p>I am using heat tool to dynamically generate window service out and
    need to exclude exe file so I could add it manually.But it is not
    working My step.build code is following</p>
  </blockquote>
  
  <h1>**</h1>
  
  <pre><code>&lt;Target Name="Harvest"&gt;
       &lt;!--Harvest all content of published result 
      Command="$(WixPath)heat dir $(Publish) -dr INSTALLFOLDER -ke -srd -cg MyWebWebComponents -var var.publishDir -gg -out $(WebSiteContentCode)"--&gt;
      &lt;Exec
          Command='"$(Wix)bin\heat" dir $(WindowServiceF) -t $(Projectdir)WixInstaller.xslt sfrag -o  -dr INSTALLFOLDER -ke -srd -cg MyWindowServiceComponents -var var.WindowServiceFDir -gg  -out $(WindowServiceGatCode)'
          ContinueOnError="false"
          WorkingDirectory="." /&gt;
    &lt;/Target&gt;
  </code></pre>
  
  <p>and transformation code is following</p>
  
  <pre><code>&lt;xsl:output method="xml" indent="yes" /&gt;
    &lt;xsl:template match="@*|node()"&gt;
      &lt;xsl:copy&gt;
        &lt;xsl:apply-templates select="@*|node()"/&gt;
      &lt;/xsl:copy&gt;
    &lt;/xsl:template&gt;
    &lt;xsl:key name="exe-search" match="wix:Component[contains(wix:File/@Source, 'GAT.GATAC.ServiceLayer.WindowsServiceHost.exe')]" use="@Id"/&gt;
    &lt;xsl:template match="wix:Component[key('exe-search', @Id)]"/&gt;
    &lt;xsl:template match="wix:ComponentRef[key('exe-search', @Id)]"
  </code></pre>
  
  <p><strong>And code in my directoryref for window service is following</strong> </p>
  
  <pre><code>&lt;Component Id="WSComponent" Guid="608b5ac0-7541-4db8-9c79-6190ff437a83"&gt;
      &lt;CreateFolder /&gt;
      &lt;!-- Remove all files from the INSTALLFOLDER on uninstall --&gt;
      &lt;RemoveFile Id="ALLFILES" Name="*.*" On="both" /&gt;
      &lt;File Id="WindowsServiceHost.exe" Source="$(var.TargitPath)GAT.GATAC.ServiceLayer.WindowsServiceHost.exe" KeyPath="yes"  Vital="yes" /&gt;
      &lt;ServiceInstall Id="ServiceInstaller"
              Type="ownProcess"
              Vital="yes"
              Name="GAT.GATAC.ServiceLayer.WindowsServiceHost"                   
              DisplayName="WindowsService"
              Description="Wickedly awesome and amazing service."
              ErrorControl="ignore"
              Start="auto"
              Interactive="no" /&gt;
  
       &lt;util:XmlFile Id="ModifyServiceLocation" Action="setValue" ElementPath="/configuration/connectionStrings/add[\[]@name='DefaultConnection'[\]]/@connectionString" File="[INSTALLFOLDER]GAT.GATAC.ServiceLayer.WindowsServiceHost.exe.config" Value="Data Source=PC4;Initial Catalog=dbGATAC;User Id=test;Password=ba"/&gt;   
     &lt;ServiceControl Id="ServiceInstaller"
                 Start="install"
                 Stop="both"
                 Remove="both"
                 Name="GAT.GATAC.ServiceLayer.WindowsServiceHost"
                 Wait="yes" /&gt;
    &lt;/Component&gt;
  
  **But I get error failed to compare two elements in the error please check** 
  </code></pre>
  
  <p>image for reference<a href="https://i.stack.imgur.com/Zf5BX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Zf5BX.png" alt="enter image description here"></a></p>