我有以下格式的输入。我想从中删除重复的元素
<pasabm:TransactionProductVO>
<pasabm:ItemNumber>100-0711-1</pasabm:ItemNumber>
<pasabm:ItemSource>EBIZ_01</pasabm:ItemSource>
<pasabm:ItemUom>Ea</pasabm:ItemUom>
<pasabm:LotNumber>043111-13</pasabm:LotNumber>
<pasabm:LotSource>EBIZ_01</pasabm:LotSource>
<pasabm:LotLocation>M1</pasabm:LotLocation>
<pasabm:ExpirationDate/>
<pasabm:TransactionSerialAssocVO>
<pasabm:ItemSerialNumber>3173041321</pasabm:ItemSerialNumber>
<pasabm:SerialType>USN-1</pasabm:SerialType>
<pasabm:SerialIdentification>100-0711-1</pasabm:SerialIdentification>
<pasabm:ParentSerialIdentification>918993-30413301-0413-23-1</pasabm:ParentSerialIdentification>
<pasabm:ShippedItemFlag>0</pasabm:ShippedItemFlag>
</pasabm:TransactionSerialAssocVO>
<pasabm:TransactionSerialAssocVO>
<pasabm:ItemSerialNumber>3173041322</pasabm:ItemSerialNumber>
<pasabm:SerialType>USN-1</pasabm:SerialType>
<pasabm:SerialIdentification/>
<pasabm:ParentSerialIdentification>918993-30413301-0413-23-1</pasabm:ParentSerialIdentification>
<pasabm:ShippedItemFlag>0</pasabm:ShippedItemFlag>
</pasabm:TransactionSerialAssocVO>
<pasabm:TransactionSerialAssocVO>
<pasabm:ItemSerialNumber>3173041323</pasabm:ItemSerialNumber>
<pasabm:SerialType>USN-1</pasabm:SerialType>
<pasabm:SerialIdentification/>
<pasabm:ParentSerialIdentification>918993-30413301-0413-23-1</pasabm:ParentSerialIdentification>
<pasabm:ShippedItemFlag>0</pasabm:ShippedItemFlag>
</pasabm:TransactionSerialAssocVO>
</pasabm:TransactionProductVO>
<pasabm:TransactionProductVO>
<pasabm:ItemNumber>100-0711-1</pasabm:ItemNumber>
<pasabm:ItemSource>EBIZ_01</pasabm:ItemSource>
<pasabm:ItemUom>Ea</pasabm:ItemUom>
<pasabm:LotNumber>043111-13</pasabm:LotNumber>
<pasabm:LotSource>EBIZ_01</pasabm:LotSource>
<pasabm:LotLocation>M1</pasabm:LotLocation>
<pasabm:ExpirationDate/>
<pasabm:TransactionSerialAssocVO>
<pasabm:ItemSerialNumber>3173041322</pasabm:ItemSerialNumber>
<pasabm:SerialType>USN-1</pasabm:SerialType>
<pasabm:SerialIdentification/>
<pasabm:ParentSerialIdentification>918993-30413301-0413-23-1</pasabm:ParentSerialIdentification>
<pasabm:ShippedItemFlag>0</pasabm:ShippedItemFlag>
</pasabm:TransactionSerialAssocVO>
<pasabm:TransactionSerialAssocVO>
<pasabm:ItemSerialNumber>3173041321</pasabm:ItemSerialNumber>
<pasabm:SerialType>USN-1</pasabm:SerialType>
<pasabm:SerialIdentification>100-0711-1</pasabm:SerialIdentification>
<pasabm:ParentSerialIdentification>918993-30413301-0413-23-1</pasabm:ParentSerialIdentification>
<pasabm:ShippedItemFlag>0</pasabm:ShippedItemFlag>
</pasabm:TransactionSerialAssocVO>
<pasabm:TransactionSerialAssocVO>
<pasabm:ItemSerialNumber>3173041323</pasabm:ItemSerialNumber>
<pasabm:SerialType>USN-1</pasabm:SerialType>
<pasabm:SerialIdentification/>
<pasabm:ParentSerialIdentification>918993-30413301-0413-23-1</pasabm:ParentSerialIdentification>
<pasabm:ShippedItemFlag>0</pasabm:ShippedItemFlag>
</pasabm:TransactionSerialAssocVO>
</pasabm:TransactionProductVO>
<pasabm:TransactionProductVO>
<pasabm:ItemNumber>100-0711-1</pasabm:ItemNumber>
<pasabm:ItemSource>EBIZ_01</pasabm:ItemSource>
<pasabm:ItemUom>Ea</pasabm:ItemUom>
<pasabm:LotNumber>043111-13</pasabm:LotNumber>
<pasabm:LotSource>EBIZ_01</pasabm:LotSource>
<pasabm:LotLocation>M1</pasabm:LotLocation>
<pasabm:ExpirationDate/>
<pasabm:TransactionSerialAssocVO>
<pasabm:ItemSerialNumber>3173041323</pasabm:ItemSerialNumber>
<pasabm:SerialType>USN-1</pasabm:SerialType>
<pasabm:SerialIdentification/>
<pasabm:ParentSerialIdentification>918993-30413301-0413-23-1</pasabm:ParentSerialIdentification>
<pasabm:ShippedItemFlag>0</pasabm:ShippedItemFlag>
</pasabm:TransactionSerialAssocVO>
<pasabm:TransactionSerialAssocVO>
<pasabm:ItemSerialNumber>3173041322</pasabm:ItemSerialNumber>
<pasabm:SerialType>USN-1</pasabm:SerialType>
<pasabm:SerialIdentification>100-0711-1</pasabm:SerialIdentification>
<pasabm:ParentSerialIdentification>918993-30413301-0413-23-1</pasabm:ParentSerialIdentification>
<pasabm:ShippedItemFlag>0</pasabm:ShippedItemFlag>
</pasabm:TransactionSerialAssocVO>
<pasabm:TransactionSerialAssocVO>
<pasabm:ItemSerialNumber>3173041321</pasabm:ItemSerialNumber>
<pasabm:SerialType>USN-1</pasabm:SerialType>
<pasabm:SerialIdentification/>
<pasabm:ParentSerialIdentification>918993-30413301-0413-23-1</pasabm:ParentSerialIdentification>
<pasabm:ShippedItemFlag>0</pasabm:ShippedItemFlag>
</pasabm:TransactionSerialAssocVO>
</pasabm:TransactionProductVO>
我期待的输出是:
<pasabm:TransactionProductVO>
<pasabm:ItemNumber>100-0711-1</pasabm:ItemNumber>
<pasabm:ItemSource>EBIZ_01</pasabm:ItemSource>
<pasabm:ItemUom>Ea</pasabm:ItemUom>
<pasabm:LotNumber>043111-13</pasabm:LotNumber>
<pasabm:LotSource>EBIZ_01</pasabm:LotSource>
<pasabm:LotLocation>M1</pasabm:LotLocation>
<pasabm:ExpirationDate/>
<pasabm:TransactionSerialAssocVO>
<pasabm:ItemSerialNumber>3173041321</pasabm:ItemSerialNumber>
<pasabm:SerialType>USN-1</pasabm:SerialType>
<pasabm:SerialIdentification>100-0711-1</pasabm:SerialIdentification>
<pasabm:ParentSerialIdentification>918993-30413301-0413-23-1</pasabm:ParentSerialIdentification>
<pasabm:ShippedItemFlag>0</pasabm:ShippedItemFlag>
</pasabm:TransactionSerialAssocVO>
<pasabm:TransactionSerialAssocVO>
<pasabm:ItemSerialNumber>3173041322</pasabm:ItemSerialNumber>
<pasabm:SerialType>USN-1</pasabm:SerialType>
<pasabm:SerialIdentification/>
<pasabm:ParentSerialIdentification>918993-30413301-0413-23-1</pasabm:ParentSerialIdentification>
<pasabm:ShippedItemFlag>0</pasabm:ShippedItemFlag>
</pasabm:TransactionSerialAssocVO>
<pasabm:TransactionSerialAssocVO>
<pasabm:ItemSerialNumber>3173041323</pasabm:ItemSerialNumber>
<pasabm:SerialType>USN-1</pasabm:SerialType>
<pasabm:SerialIdentification/>
<pasabm:ParentSerialIdentification>918993-30413301-0413-23-1</pasabm:ParentSerialIdentification>
<pasabm:ShippedItemFlag>0</pasabm:ShippedItemFlag>
</pasabm:TransactionSerialAssocVO>
</pasabm:TransactionProductVO>
答案 0 :(得分:0)
使用XSLT 1.0使用 the Muenchian method for grouping 。
使用XSLT 2.0使用 <xsl:for-each-group>
。