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.
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
you can try the following in BPEL,
Assign this response to a new variable lets say originalResponse,
Run a for each loop in BPEL for the count of this UserObjectId in this response, count($ReadUserOBSResponse/UserOBS)
assign the value of $ReadUserOBSResponse/UserOBS[$forEachCounter]/UserObjectId to a variable say y
count the number of$ReadUserOBSResponse/UserOBS/UserObjectId with value =y, count($ReadUserOBSResponse/UserOBS[./UserObjectId=$y]) to variable z
if (count>1) then delete the node from originalReponse using the remove construct in BPEL.
<bpelx:target variable="originalResponse" part="response "? query="$ReadUserOBSResponse/UserOBS[./UserObjectId=$y]" />