Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

XSLT in BPEL : Get only elements that are not repeating in an XML

kiransaraviMay 4 2013 — edited Feb 26 2020
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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 2 2013
Added on May 4 2013
1 comment
322 views