Answers for "Find duplicates in xml doc and apply condition in it using XQuery" https://knowledge.亚搏在线safe.com/questions/97998/find-duplicates-in-xml-doc-and-apply-condition-in.html The latest answers for the question "Find duplicates in xml doc and apply condition in it using XQuery" Answer by takashi https://knowledge.safe.com/answers/98037/view.html

Hi @vvoona, this is a possible expression, assuming that the variable $doc stores the source XML document.

for $id in distinct-values($doc//id/text()) where 1 < count($doc//id[text() = $id]) return $doc//book[data(id) = $id and normalize-space(data(status)) = 'published']
Wed, 04 Sep 2019 00:30:09 GMT takashi