I have an XML database which contains elements which have an id. These are all unique. They also have a secondary identifier which links them to a similar object in another database. These are not all unique.
Is there an XQuery which would let me identify all the non-unique IDs? I can count how many there are using distinct-values(), but that doesn't help identify the IDs which have duplicates!
Example XML: (each object is contained in a separate file in the eXist database)
<object id="uniqueID123">
<secondary identifier="nonUnique888"/>
</object>
<object id="uniqueID456">
<secondary identifier="nonUnique888"/>
</object>
<object id="uniqueID789">
<secondary identifier="Unique999"/>
</object>
I would want to identify the duplicated string "nonUnique888".