In your
JSP page, include the javascript validation funcitons that you want. Then also in your JSP page, do all of the calls necessary to apply a stylesheet to your XML data and print the resulting transformation in your page. Now,in your XSL stylesheet, just include the javascript calls as part of your XSL. For example (remember that all text from your XSL document will be carried over to your result document):
<xml:template match="/"
<TABLE><TR> .. or whatever HTML you want
<INPUT TYPE="IMAGE" SRC="/images/gobtn2.gif" ALT="Go" BORDER="0" ONCLICK="validate()"/></TD>
</xml:template>
So the Style sheet contains the javascript that will be included in the page upon completion of the transformation. Thus when your page loads you have a complete page with javascript code and javascript function calls.
We are doing this a lot where I work and it all works well together.
HTH
Brian