Evaluating patterns

Patterns are essentially a grouping mechanism for rules. They can contain variables (represented by let), which are unusual in that they are local in scope to the containing pattern, but are evaluated in the context of the instance document root.[39] This change in scope but not evaluation context means the map of bindings must be updated for every pattern.

This behaviour differs from that of the XSLT implementations.[40]



[39] This differs from rule variables, which are evaluated in the context of the nodes returned by evaluating rule/@context.

[40] See https://github.com/schxslt/schxslt/issues/135 for details regarding the behaviour of SchXslt here.