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

[XSLT] Composite merge keys #1684

Closed
michaelhkay opened this issue Jan 8, 2025 · 0 comments · Fixed by #1689
Closed

[XSLT] Composite merge keys #1684

michaelhkay opened this issue Jan 8, 2025 · 0 comments · Fixed by #1689
Labels
Enhancement A change or improvement to an existing feature PR Pending A PR has been raised to resolve this issue XSLT An issue related to XSLT

Comments

@michaelhkay
Copy link
Contributor

michaelhkay commented Jan 8, 2025

The changes in PR #1674 to allow composite sort keys automatically propagate to xsl:merge, because the semantics of xsl:merge-key are defined entirely by reference to xsl:sort.

No immediate problem, except (1) we should acknowledge the fact and point out that composite merge keys are now allowed, and (2) the effect on the current-merge-key() function. This is the sequence-concatenation of the merge keys for multiple merge sources. The spec says:

the [current merge key] will be a single atomic item if there is a single merge key, or a sequence of atomic items if there are multiple merge keys.

Actually I think that's already wrong, because it forgets that an individual merge key may be an empty sequence. If that happens then the current-merge-key() function is somewhat useless. I suggest we simply document the fact: if there are multiple merge sources generating multiple merge keys and they are not all singletons, then the sequence concatenation of the merge keys may not be especially useful.

We could provide a variant current-merge-key-array() that returns an array of sort key values, one for each xsl:merge-key element, each one being a sequence of atomic items.

@michaelhkay michaelhkay changed the title Composite merge keys [XSLT] Composite merge keys Jan 8, 2025
@michaelhkay michaelhkay added XSLT An issue related to XSLT Enhancement A change or improvement to an existing feature labels Jan 8, 2025
@michaelhkay michaelhkay added the PR Pending A PR has been raised to resolve this issue label Jan 9, 2025
@ndw ndw closed this as completed in #1689 Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement A change or improvement to an existing feature PR Pending A PR has been raised to resolve this issue XSLT An issue related to XSLT
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant