Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

123: fn:duplicate-values #614

Merged
merged 3 commits into from
Jul 18, 2023
Merged

123: fn:duplicate-values #614

merged 3 commits into from
Jul 18, 2023

Conversation

ChristianGruen
Copy link
Contributor

I decided to create a PR for the initial proposal of this function, as I came across at least two other use cases for it since the issue was created.

I believe that the group by clause is the best choice for more complex operations, such as advanced comparisons or creating histograms.

@michaelhkay
Copy link
Contributor

It's unfortunate that the function cannot, in fact, be implemented using a FLWOR group-by clause, as that does not support dynamic collations. Perhaps it would be better to provide an XSLT implementation:

<xsl:for-each-group select="$values" group-by="." collation="{$collation}">
  <xsl:sequence select="current-group()[2]"/>
</xsl:for-each>

(although this differs in that the result is more strictly defined; to be precisely equivalent, you would want to randomise the order of the input).

@ChristianGruen
Copy link
Contributor Author

Perhaps it would be better to provide an XSLT implementation:

Added, thanks.

@ChristianGruen
Copy link
Contributor Author

The example has been fixed; I’m optimistic this can be merged.

@ndw
Copy link
Contributor

ndw commented Jul 18, 2023

The CG agreed to merge this PR at meeting 042.

@ndw ndw merged commit f961ae2 into qt4cg:master Jul 18, 2023
@ChristianGruen ChristianGruen deleted the 123 branch July 19, 2023 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants