最初に、「重複ノードの削除が期待どおりに機能しない」と言って申し訳ありませんが、複数のスレッドを参照してある程度の範囲を拡大するのに役立ちましたが、それでも期待した解決策に達していません。
私のケースを簡単に説明すると、次の子孫でサプライヤーと origin_country_id が同じ場合、XitemSup 複合型要素を削除したいと思います。
以下はxsltコードです
<xsl:stylesheet version="1.0" exclude-result-prefixes="xsl xsd ns3"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ns3="http://xmlns.oracle.com/TSS_to_RMS/RIBXItemProcess/Supplier">
<xsl:template match="/">
<ns3:XItemSupDesc>
<xsl:for-each select="//ns3:XItemSupDesc/ns3:XitemSup">
<xsl:if test="not(ns3:supplier=following::ns3:supplier) or not(ns3:origin_country_id=following::ns3:origin_country_id)">
<ns3:XitemSup>
<ns3:supplier>
<xsl:value-of select="./ns3:supplier"/>
</ns3:supplier>
<ns3:primary_supp_ind>
<xsl:value-of select="./ns3:primary_supp_ind"/>
</ns3:primary_supp_ind>
<ns3:origin_country_id>
<xsl:value-of select="./ns3:origin_country_id"/>
</ns3:origin_country_id>
<ns3:primary_country_ind>
<xsl:value-of select="./ns3:primary_country_ind"/>
</ns3:primary_country_ind>
<ns3:unit_cost>
<xsl:value-of select="./ns3:unit_cost"/>
</ns3:unit_cost>
</ns3:XitemSup>
</xsl:if>
</xsl:for-each>
</ns3:XItemSupDesc>
</xsl:template>
</xsl:stylesheet>
しかし、xmlの下に適用すると機能しません
<XItemSupDesc xmlns:ns2="http://xmlns.oracle.com/TSS_to_RMS/RIBXItemProcess/Supplier" xmlns="http://xmlns.oracle.com/TSS_to_RMS/RIBXItemProcess/Supplier">
<ns2:XitemSup>
<ns2:supplier>101018</ns2:supplier>
<ns2:primary_supp_ind>N</ns2:primary_supp_ind>
<ns2:origin_country_id>CA</ns2:origin_country_id>
<ns2:primary_country_ind>N</ns2:primary_country_ind>
<ns2:unit_cost>6</ns2:unit_cost>
</ns2:XitemSup>
<ns2:XitemSup>
<ns2:supplier>102825</ns2:supplier>
<ns2:primary_supp_ind>N</ns2:primary_supp_ind>
<ns2:origin_country_id>IN</ns2:origin_country_id>
<ns2:primary_country_ind>N</ns2:primary_country_ind>
<ns2:unit_cost>13</ns2:unit_cost>
</ns2:XitemSup>
<ns2:XitemSup>
<ns2:supplier>102825</ns2:supplier>
<ns2:primary_supp_ind>N</ns2:primary_supp_ind>
<ns2:origin_country_id>IN</ns2:origin_country_id>
<ns2:primary_country_ind>N</ns2:primary_country_ind>
<ns2:unit_cost>24</ns2:unit_cost>
</ns2:XitemSup>
</XItemSupDesc>
XSLTコードのどこが間違っているのか誰かが教えてくれることを願っています。