Nothing obviously wrong with this code. What does the code in the stylesheet look like, what's your evidence that the value isn't available? What product are you using? (The JAXP specification doesn't actually say what classes of object can be passed to the second arg of setParameter(). I would expect most implementations to accept an Integer, but you need to check the product specifications to be sure).
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference