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: Built-in template rules for maps and arrays #570

Closed
michaelhkay opened this issue Jun 23, 2023 · 2 comments · Fixed by #718
Closed

XSLT: Built-in template rules for maps and arrays #570

michaelhkay opened this issue Jun 23, 2023 · 2 comments · Fixed by #718
Labels
Feature A change that introduces a new feature XSLT An issue related to XSLT

Comments

@michaelhkay
Copy link
Contributor

The current built-in template rules for maps and arrays do not work well for a recursive-descent traversal of a JSON-like tree of maps and arrays. The effect of on-no-match="shallow-copy" is to do a deep copy, and the effect of on-no-match="shallow-skip" is to do a deep skip. I therefore propose two new values for on-no-match, provisionally "shallow-copy-all" and "shallow-skip-all".

For more details see my Balisage 2022 paper: https://balisage.net/Proceedings/vol27/html/Kay01/BalisageVol27-Kay01.html

We do in fact have some test cases that use this syntax, see attr/mode-4001 et seq, but it has never found its way into the spec.

@Arithmeticus
Copy link
Contributor

Yes, please. I've gotten around this restriction by writing, for every shallow-copy mode, explicit template rules for arrays and maps that do such shallow copying. It would be nice to avoid those extra steps.

@michaelhkay
Copy link
Contributor Author

I've been writing this up and I think I have a clean specification for shallow-copy-all, but I've been having trouble coming up with a spec for shallow-skip-all that does anything remotely useful. It can flatten an array to a sequence of members, but it can't do anything very useful with a map. So I shall leave that one out.

@michaelhkay michaelhkay added XSLT An issue related to XSLT Feature A change that introduces a new feature PR Pending A PR has been raised to resolve this issue labels Sep 21, 2023
@ndw ndw closed this as completed in #718 Sep 26, 2023
@ChristianGruen ChristianGruen removed the PR Pending A PR has been raised to resolve this issue label Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature A change that introduces a new feature XSLT An issue related to XSLT
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants