Re: [xsl] user-defined XSLT functions and stylesheet variables?

Subject: Re: [xsl] user-defined XSLT functions and stylesheet variables?
From: "Michael Kay mike@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 20 Jun 2021 08:01:01 -0000
> But i agree there are cases where it makes sense.   Sometimes i write,
>  <xsl:variable name="input" select="/" />
> for example,

Yep, we all do that, and it's very handy, but it also has a devastating
impact: it severely restricts your abiliity to reuse your code. If you've got
a stylesheet that processes a single document, and you want to change it to
process a collection of documents, that global variable will no longer be
available. I've fallen into that trap so many times...

Michael Kay
Saxonica

Current Thread