I have some XML and I need to query all <USER> nodes, specifically if the <userID> values are all the same. The node I want to check is userID. In the below example notice that the 2 <userID> values are different, so I would want the result of the XPath evaluation to be false.
Sample XML:
<xml>
<CHANGE_USER_001>
<USER>
<userID>joebloggs</userID>
</USER>
</CHANGE_USER_001>
<CHANGE_USER_001>
<USER>
<userID>joebloggs1</userID>
</USER>
</CHANGE_USER_001>
</xml>
My attempt at xpath command is
//USER/userID='joebloggs'
The query returns true but I would like to test against each <userID> node.
If returning a boolean is not possible then I could get the number of <userID> nodes, and then get the number of <userID> rows equal to my specific value, and then compare them, but how to check all <userID> nodes for the same value?