Subject: Re: [xsl] XQuery/XPath 3.1: Node List to Node Set ("distinct nodes") From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Tue, 28 Dec 2021 21:56:02 -0000 |
$nodes/. would re-order them in document order if that matters.
As the question says XQuery/XPath 3.1, if the order in the original sequence / node list matters, generate-id made it from XSLT into newer versions of XPath and XQuery I think so you could use grouping by generate-id() plus sorting (as the normal XQuery group by clause doesn't preserve the order necessarily)
for $node at $pos in $nodes group by $id := generate-id($node) order by $pos[1] return $node[1]
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] XQuery/XPath 3.1: Node Li, Martin Honnen martin | Thread | Re: [xsl] XQuery/XPath 3.1: Node Li, Michael Kay mike@xxx |
Re: [xsl] XQuery/XPath 3.1: Node Li, Martin Honnen martin | Date | Re: [xsl] XQuery/XPath 3.1: Node Li, Michael Kay mike@xxx |
Month |