I need to replace
- the RemoveFolder element, Id attribute, values of ZYXYZ123456
replace them with their respective / parent
- Directory element, Id attribute values
Input XML
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:wix="http://wixtoolset.org/schemas/v4/wxs">
<?include
$(sys.CURRENTDIR)Deployment\Data\Statics.wxi
?>
<Fragment>
<DirectoryRef Id="TARGETFOLDER">
<Directory Id="dir3927012B444F1DB745782B917DAF8F52" Name="de">
<Component Id="cmp0B1BB8F3CC5ABCC8B2DC21EFF552B101" Guid="{61855CC1-97FD-4F9A-BE4D-58BB84E3D45F}">
<File Id="fil6E782DCD75BB9136587D1C2C3C8405DA" Source="$(var.Fundraisin.TargetDir)\de\System.Windows.Interactivity.resources.dll" />
<RemoveFolder Id="ZYXYZ123456" On="uninstall" />
<RegistryValue Root="HKCU" Key="$(var.App.Reg.Path)" Name="deSystemWindowsInteractivityresourcesdllKey" Type="integer" Value="1" KeyPath="yes" />
</Component>
</Directory>
<Directory Id="dir030901E2EAEF85FABAA23B70A484C2DA" Name="en">
<Component Id="cmp0B23CA905283819B80BD5BCA1DD53351" Guid="{BA8BDBDA-8383-48FC-A72E-DB0BD30F8C0F}">
<File Id="filC47344F28A098B48E37BBEDF62663A84" Source="$(var.Fundraisin.TargetDir)\en\System.Windows.Interactivity.resources.dll" />
<RemoveFolder Id="ZYXYZ123456" On="uninstall" />
<RegistryValue Root="HKCU" Key="$(var.App.Reg.Path)" Name="enSystemWindowsInteractivityresourcesdllKey" Type="integer" Value="1" KeyPath="yes" />
</Component>
</Directory>
<Component Id="cmpA1CA940DDE5CB7E5A98DA7931F3F25F2" Guid="{A6D33CD8-9235-43EC-972C-ED07B3B1E1E8}"><File Id="fil324414361723D2D64834B378C0B7C68B" Source="$(var.Fundraisin.TargetDir)\Castle.Core.dll" /><RegistryValue Root="HKCU" Key="$(var.App.Reg.Path)" Name="CastleCoredllKey" Type="integer" Value="1" KeyPath="yes" /></Component>
<Component Id="cmpE41CA83817294A110F385AC18AFC4A10" Guid="{875D5B4F-E03B-4C4D-A14C-494BA2F061DA}"><File Id="filB9649B9DA6A66326E4F8C66B490ED552" Source="$(var.Fundraisin.TargetDir)\Castle.Windsor.dll" /><RegistryValue Root="HKCU" Key="$(var.App.Reg.Path)" Name="CastleWindsordllKey" Type="integer" Value="1" KeyPath="yes" /></Component>
</DirectoryRef>
</Fragment>
<Fragment>
<ComponentGroup Id="Dlls">
<ComponentRef Id="cmpA1CA940DDE5CB7E5A98DA7931F3F25F2" />
<ComponentRef Id="cmpE41CA83817294A110F385AC18AFC4A10" />
<ComponentRef Id="cmp0B1BB8F3CC5ABCC8B2DC21EFF552B101" />
<ComponentRef Id="cmp0B23CA905283819B80BD5BCA1DD53351" />
</ComponentGroup>
</Fragment>
</Wix>
Part of Desired Output
...
<Directory Id="dir3927012B444F1DB745782B917DAF8F52" Name="de">
<Component Id="cmp0B1BB8F3CC5ABCC8B2DC21EFF552B101" Guid="{61855CC1-97FD-4F9A-BE4D-58BB84E3D45F}">
<File Id="fil6E782DCD75BB9136587D1C2C3C8405DA" Source="$(var.Fundraisin.TargetDir)\de\System.Windows.Interactivity.resources.dll" />
<RemoveFolder Id="dir3927012B444F1DB745782B917DAF8F52" On="uninstall" />
<RegistryValue Root="HKCU" Key="$(var.App.Reg.Path)" Name="deSystemWindowsInteractivityresourcesdllKey" Type="integer" Value="1" KeyPath="yes" />
</Component>
</Directory>
...
XSLT Substitute Attribute Value with Another Attribute Value
how to COPY Attribute value in a new attribute may be a start, but I know too little XSLT to take it further?