This code looks as if it is server-based, in that it's constructing a URL with query parameters to support the "next" and "previous" links. Is your transformation running server-side? If not, you'll need to modify it so that instead of constructing a URL, it constructs a Javascript call to a function in your HTML page that invokes a new transformation.
If you can't afford to buy my book, try searching for tutorials on client-side XSLT. There are plenty around, though they are mixed quality.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference