特定の属性を含むリーフ要素の xml ドキュメントをフィルター処理しようとしていますが、より高いレベルのドキュメントをそのまま維持したいと考えています。そして、これを XSLT で実現したいと考えています。
最初のドキュメントは次のようになります。
<root>
<a name="foo">
<b name="bar" critical="yes"/>
</a>
<a name="foo2" critical="yes">
<b name="bar2">
<b name="bar3">
</a>
<a name="foo3">
<b name="bar4">
<b name="bar5">
</a>
</root>
結果は次のようになります。
<root>
<a name="foo">
<b name="bar" critical="yes"/>
</a>
<a name="foo2" critical="yes">
</a>
</root>
XSLT は私の母国語ではないため、どんな助けも大歓迎です。