Re: Recursion in XPath 3.1 inline function definition

XSLT 3.0 indeed has a rule that a global variable is not in scope within its own declaration. See 9.5:

[Definition: A top-level <https://www.w3.org/TR/xslt-30/#dt-top-level> variable-binding element <https://www.w3.org/TR/xslt-30/#dt-variable-binding-element> declares a global variable that is visible everywhere (except within its own declaration, and where it is shadowed <https://www.w3.org/TR/xslt-30/#dt-shadows> by another binding).]

This rule has been removed in 4.0, making your example legal in 4.0.

Michael Kay
Saxonica

Received on Saturday, 29 March 2025 09:12:12 UTC