XSLT in BPEL : Get only elements that are not repeating in an XML
Hope you are doing fine I have a scenario where the XML doc contains some nodes that are repeating. I want to get rid of all such nodes. Please note that this is not "Removing Duplicates". I want to completely remove all entries of those nodes that are occuring more than once.
Ex My XML
<ReadUserOBSResponse>
<UserOBS>
<OBSObjectId>1510</OBSObjectId>
<UserObjectId>443</UserObjectId>
</UserOBS>
<UserOBS>
<OBSObjectId>540</OBSObjectId>
<UserObjectId>514</UserObjectId>
</UserOBS>
<UserOBS>
<OBSObjectId>1521</OBSObjectId>
<UserObjectId>514</UserObjectId>
</UserOBS>
<UserOBS>
<OBSObjectId>547</OBSObjectId>
<UserObjectId>544</UserObjectId>
</UserOBS>
</ReadUserOBSResponse>
Desired Output : I want to remove both entries with UserObjectId 514
<ReadUserOBSResponse>
<UserOBS>
<OBSObjectId>1510</OBSObjectId>
<UserObjectId>443</UserObjectId>
</UserOBS>
<UserOBS>
<OBSObjectId>547</OBSObjectId>
<UserObjectId>544</UserObjectId>
</UserOBS>
</ReadUserOBSResponse>
I've done some things, but its not working. My Idea was to count the nodes with UserObjectId as the current value, put this in an xsl:if and then print the nodes. But I'm not sure how to write this snippet. Would you please help me in this regard. Thanks in Advance