次のようなドキュメントがあります。
<test>
<testOne>
<testTwo>AAA</testTwo>
<testOne>
<testOne>
<testTwo>BBB</testTwo>
<testOne>
<testOne>
<testTwo>CCC</testTwo>
<testOne>
<testOne>
<testTwo>DDD</testTwo>
<testOne>
<testOne>
<testTwo>EEE</testTwo>
<testOne>
</test>
xsl では、次のようにしてこのノードセットを簡単に取得できます。
<xsl:variable name="testOnes" select="//test/testOne">
ただし、私が抱えている問題は、次のようなノードセットを形成するために満たさなければならない条件があることです。
if testOne[testTwo='AAA'] exists select all nodes except those of form testOne[testTwo='BBB']
and if testOne[testTwo='CCC'] exists then select all nodes except those of form testOne[testTwo='DDD']
たとえば、上記のルールに従って、特定の xpath からこの結果を取得する必要があります。
<test>
<testOne>
<testTwo>AAA</testTwo>
<testOne>
<testOne>
<testTwo>CCC</testTwo>
<testOne>
<testOne>
<testTwo>EEE</testTwo>
<testOne>
</test>
これを達成できるifステートメントを使用してxpathを作成する方法、またはノードセットの内容をチェックして別のノードが見つかった場合に1つのノードを削除できるxslコードを作成する方法はありますか?