The first thing you need to do is to work out why you aren't seeing the error that Saxon is saying it has reported. Unless you did something special to redirect it, it will have been written to the standard error output. By default that goes to the console, but if you're in some kind of environment like an application server it probably goes to a log file somewhere. You can nominate your own ErrorListener to be notified of the errors, and then you can decide where to display them. There's not really much point trying to debug a stylesheet until you've got a development environment where you can see the error messages.
If I copy this to a file and run it from the command line the stylesheet compiles OK; so the problem is probably local to your environment. But there's no point speculating until you can find where that error message has been written.
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference