キーを使わずにひどく悪いxsltを書くことができますが、それはかなり遅くて面倒です。誰も私は次のXMLファイルを期待どおりの結果にきれいに変換する方法を知っていますか?ありがとう!キーを使用してこれを変換する方法
入力:
<testExecution>
<test>
<test.1/>
<test.2/>
<test.3/>
</test>
<comment>
<comment.1/>
<comment.2/>
<comment.3/>
</comment>
<executor>
<executor.1/>
<executor.2/>
<executor.3/>
</executor>
<comment>
<comment.1/>
<comment.2/>
<comment.3/>
</comment>
<comment>
<comment.1/>
<comment.2/>
<comment.3/>
</comment>
<invoker>
<invoker.1/>
<invoker.2/>
<invoker.3/>
</invoker>
<recipient>
<recipient.1/>
<recipient.2/>
<recipient.3/>
</recipient>
<comment>
<comment.1/>
<comment.2/>
<comment.3/>
</comment>
<comment>
<comment.1/>
<comment.2/>
<comment.3/>
</comment>
</testExecution>
結果:
<testExecution>
<test>
<test.1/>
<test.2/>
<test.3/>
</test>
<comment>
<comment.1/>
<comment.2/>
<comment.3/>
</comment>
<people>
<importantPeople>
<executor>
<executor.1/>
<executor.2/>
<executor.3/>
</executor>
<comment>
<comment.1/>
<comment.2/>
<comment.3/>
</comment>
<comment>
<comment.1/>
<comment.2/>
<comment.3/>
</comment>
</importantPeople>
<invoker>
<invoker.1/>
<invoker.2/>
<invoker.3/>
</invoker>
</people>
<recipient>
<recipient.1/>
<recipient.2/>
<recipient.3/>
</recipient>
<comment>
<comment.1/>
<comment.2/>
<comment.3/>
</comment>
<comment>
<comment.1/>
<comment.2/>
<comment.3/>
</comment>
</testExecution>
良い質問、+1。アイデンティティルールを使用してオーバーライドし、次の 'comments'にキーを使用する伝統的なXSLTソリューションについては、私の答えを参照してください。 –