私はXSL変換に非常に慣れていないので、ここで質問します。このxmlファイルがある場合:
<root>
<node id="a">
<section id="a_1">
<item id="0">
<attributes>
<color>Red</color>
</attributes>
</item>
</section>
<section id="a_2">
<item id="0">
<attributes>
<color>Red</color>
</attributes>
</item>
</section>
</node>
<node id="b">
<section id="b_1">
<user id="b_1a">
<attribute>
<name>John</name>
</attribute>
</user>
<user id="b_1b">
<attribute></attribute>
</user>
<user id="b_1a">
<attribute>
<name>John</name>
</attribute>
</user>
</section>
</node>
</root>
そして、私は出力を次のようにしたいと思います:
<root>
<node id="a">
<section id="a_1">
<item id="0">
<attributes>
<color>Red</color>
</attributes>
</item>
</section>
<section id="a_2">
<item id="0">
<attributes>
<color>Red</color>
</attributes>
</item>
</section>
</node>
<node id="b">
<section id="b_1">
<user id="b_1a">
<attribute>
<name>John</name>
</attribute>
</user>
<user id="b_1b">
<attribute></attribute>
</user>
</section>
</node>
</root>
問題は、レベルがどれだけ深くなるかわからないことですが、同じレベルにあり、重複している限り、それを削除します。これを行うことは可能ですか。私は一日中これを修正しようとしてきましたが、手がかりがありません。どんな助けでも大歓迎です。
乾杯、ジョン