| Past versions of the Microsoft XML processor (MSXML 2.6 and below) supported the use of jscript functions within XSLT to perform various subroutines. However, newer versions and other XML APIs don't. You can do just about anything within XSLT that you'd be able to accomplish through JavaScript, but it's a different way of thinking about it.
I would recommend looking into XSLT named templates (http://www.devx.com/getHelpOn/10MinuteSolution/20363), which are somewhat analogous to javascript functions.
Keep in mind that scope and context - where you are in the processing of a given node and what data is available to you - is very important. It's particularly hard to set and manipulate global variables as you transform XML with XSLT.
Good luck. |