I have a big XML file wherein there are 2 nodes which are quite similar. Based on a value from the 1st node I need to remove the non-required repetitions of second node.
Example XML:
<ABC>
<Project>
<ProjectBaselines>
<Baseline current="true" ID="01" />
<Baseline current="false" ID="02" />
<Baseline current="false" ID="03" />
</ProjectBaselines>
</Project>
<Tasks>
<Task>
<Bline ID="01" />
<Bline ID="02" />
<Bline ID="03" />
<Bline ID="04" />
</Task>
</Tasks>
</ABC>
XSLT:
<xsl:template match="Baseline[@current !='true']"/>
<xsl:template match="Bline[@ID != *ID of the Baseline node where current=true*]" />
With the first line of XSLT I am able to remove all the <Baseline> nodes where the current is false; however I am not able to find a way to pass the ID value from <Baseline> tag where current=true.