So, there is this element that can occur in a lot of elements and I should remove all of them that are within a specific element or its descendants. I can't seem to figure out how to approach it, because the relation is not "fixed". So I provided an example to get my point across:
Input:
<a>
<b>
<d value="1"></d>
<b/>
<b>
<c>
<d value="2"></d>
<d value="1"></d>
</c>
<d value="1">
<d value="2">
<b/>
</a>
Wanted output:
<a>
<b>
<d value="1"></d>
<b/>
<b>
<c>
<d value="2"></d>
</c>
<b/>
</a>
You see the output just has the first element with value="1" or value="2". Is this even possible with XSL?
You could use a variation on Muenchian grouping:
XSLT 1.0