Where to put your XSLT variables

You can put a variable in lots of places, including

Inside the root <xsl:stylesheet> element
This makes the variable GLOBAL.
As a child of <xsl:template>
This makes the variable accessible everywhere in that template.
Inside another <xsl:variable> element
A variable is always accessible only at the level it is declared.
XSL Variables, slide 10 of 11