Firstly, don't think of your XSLT code as calling the Javascript or passing parameters to it. That's not what's happening. The XSLT code is generating an HTML page and the HTML page happens to have some Javascript in it. As far as the XSLT code is concerned, you're just outputting HTML text.
A stylesheet has to be well-formed XML, so you can't write
<elem attr="abc<xsl:value-of select="x"/>xyz"/>
Instead, you write
<elem attr="abc{x}xyz"/>
It's called an attribute value template.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference