feat: xsl:param and xsl:with-param on named templates#2
Closed
no-pictures[bot] wants to merge 1 commit into
Closed
feat: xsl:param and xsl:with-param on named templates#2no-pictures[bot] wants to merge 1 commit into
no-pictures[bot] wants to merge 1 commit into
Conversation
A named template's declared parameters follow its context parameters. xsl:call-template supplies each by name via xsl:with-param, or uses the parameter's own default when the call omits it.
gronke
approved these changes
Jul 19, 2026
Author
|
Closing in favor of Paligo#145, which implements xsl:param and xsl:with-param. The params branch stays for reference. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Builds on #1 (base
named-templates).A named template's function now takes its declared parameters after the three context parameters, and
xsl:call-templatesupplies each argument.How it works
named_template_functionbinds the declaredxsl:paramnames as function parameters after the context parameters.xsl:call-templatebuilds the arguments in the template's parameter order, taking the matchingxsl:with-paramor falling back to the parameter's own default when the call omits it.The argument plumbing from #1 already carries any argument count, so this stays a compiler-only change with no
xee-iror interpreter edits.Tests
test_call_template_with_paramsupplies a parameter,test_call_template_param_defaultomits one and falls back to its default, and the suite stays green.Not covered
A parameter default that references another parameter of the same template reports an unbound variable, because the default is lowered in the caller's scope where the sibling parameter is not bound.
Constant and context-dependent defaults work, since the caller's context is preserved.