I'm at a dead end. Given an XML document like:
<Frag>
<DirRef Id="BeemzDir">
<Com Id="BEED24F05AB78FB588F61D4092654B6D" Guid="{A11AB356-2F45-4157-92EF-ED49F5BE0F70}">
<FileName Id="fil1" KeyPath="yes" Source="My.Exe" />
</Com>
<Com Id="FFF24F05AB78FB588F61D4092654CCC" Guid="{A11AB356-2F45-4157-92EF-ED49F5BE0F70}">
<FileName Id="fil2" KeyPath="yes" Source="My.Dll" />
</Com>
</DirRef>
</Frag>
<Frag>
<ComGroup Id="MyGroup">
<CompRef Id="BEED24F05AB78FB588F61D4092654B6D" />
<CompRef Id="FFF24F05AB78FB588F61D4092654CCC" />
</ComGroup>
</Frag>
I need to use xslt to remove the element that Source = "My.Exe" is in. In this case, delete the "Com" element, where its attribute id = BEED24F05AB78FB588F61D4092654B6D.
I have done it. But what I cannot do also removes the "CompRef" element, where Id = BEED24F05AB78FB588F61D4092654B6D.
So, after the conversion, I want my xml to look like this:
<Frag>
<DirRef Id="BeemzDir">
<Com Id="FFF24F05AB78FB588F61D4092654CCC" Guid="{A11AB356-2F45-4157-92EF-ED49F5BE0F70}">
<FileName Id="fil2" KeyPath="yes" Source="My.Dll" />
</Com>
</DirRef>
</Frag>
<Frag>
<ComGroup Id="MyGroup">
<CompRef Id="FFF24F05AB78FB588F61D4092654CCC" />
</ComGroup>
</Frag>
Any help would be appreciated.
Update
Here are a few xml that remove the "FileName" element.
<xsl:template match="Com/FileName[contains(@Source,'My.Exe')='true']">
</xsl:template>
So the result is:
<Frag>
<DirRef Id="BeemzDir">
<Com Id="BEED24F05AB78FB588F61D4092654B6D" Guid="{A11AB356-2F45-4157-92EF-ED49F5BE0F70}">
</Com>
<Com Id="FFF24F05AB78FB588F61D4092654CCC" Guid="{A11AB356-2F45-4157-92EF-ED49F5BE0F70}">
<FileName Id="fil2" KeyPath="yes" Source="My.Dll" />
</Com>
</DirRef>
</Frag>
<Frag>
<ComGroup Id="MyGroup">
<CompRef Id="BEED24F05AB78FB588F61D4092654B6D" />
<CompRef Id="FFF24F05AB78FB588F61D4092654CCC" />
</ComGroup>
</Frag>
Changing the above xsl that calls xsl: apply-template does nothing, since it is stuck in the node of its operation. I do not know how to store the identifiers that I want to delete, and then scroll through them.
2
node, "Com", source = "MyExe". , Id , -.