1
p.xml查找XQuery與主根相同節點值
<documents>
<dblp>
<inproceedings>
<author>John Cieslewicz</author>
<author>Kenneth A. Ross</author>
<author>Kenneth A. Ross</author>
</inproceedings>
</dblp>
<dblp>
<inproceedings>
<author>Yi-Reun Kim</author>
<author>Kyu-Young Whang</author>
<author>John Cieslewicz</author>
</inproceedings>
</dblp>
<documents>
我的代碼是
for $c in doc("C:\Users\User\Desktop\p.xml")//documents/dblp/inproceedings
where fn:count($c/author) != fn:count(fn:distinct-values($c/author))
return $c/author
我需要約翰Cieslewicz和肯內特·A·羅斯在結果但只顯示Kenneth A. Ross
@BeniBala謝謝! – Sandy