<div dir="ltr">xquery version "3.1";<br><br>let $schemaCollection := "/db/apps/schemas"<br> return collection($schemaCollection)/xs:schema/distinct-values(@targetNamespace)<br><div><br></div><div>does not eliminate duplicates</div><div><br></div><div>xquery version "3.1";<br><br>let $schemaCollection := "/db/apps/schemas"<br> return collection($schemaCollection)/xs:schema/@targetNamespace => distinct-values()<br></div><div><br></div><div>does.</div><div><br></div><div>I checked this in Saxon and exist-db XQuery, both return the same results so this may be how it's supposed to work but I don't get it. </div><div><br></div><div><br></div></div>