Skip to content
New issue

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

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

Already on GitHub? # to your account

Union patterns in XSLT #1770

Open
michaelhkay opened this issue Feb 5, 2025 · 0 comments · May be fixed by #1772
Open

Union patterns in XSLT #1770

michaelhkay opened this issue Feb 5, 2025 · 0 comments · May be fixed by #1772
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 Feb 5, 2025

The original XSLT 1.0 rule for union patterns such as match="A|B" said that the default priority was calculated as if there were two separate template rules with match="A" and match="B". This became more complicated with the introduction of xsl:next-match in XSLT 2.0 - what should happen if the item matches both branches? It became more complicated again in XSLT 3.0 with the introduction of on-multiple-match - is it a multiple match if an item matches both branches? And in 4.0 it's complicated further by the introduction of constructs like match="element(A|B)" which is deemed equivalent to match=A|B.

I would like to break this cycle with a backwards-incompatible change. The default priority of a union pattern should be the numeric maximum of the default priorities of its branches; the treatment as being somewhat-equivalent to two separate template rules should go. We should encourage implementations to issue a compatibility warning if a union pattern appears with no explicit priority, and with multiple branches having different default priority.

@michaelhkay michaelhkay added XSLT An issue related to XSLT Enhancement A change or improvement to an existing feature Blocked PR is blocked (has merge conflicts, doesn't format, etc.) PR Pending A PR has been raised to resolve this issue and removed Blocked PR is blocked (has merge conflicts, doesn't format, etc.) labels Feb 5, 2025
# for free to join this conversation on GitHub. Already have an account? # 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