The messages are sent to the ErrorListener (if you use JAXP, this is the ErrorListener set on the TransformerFactory; if you use s9api, it is the ErrorListener set on the XsltCompiler.) The default ErrorListener sends the messages to System.err.
So your choices are
(a) write your own ErrorListener, perhaps by subclassing the standard one
(b) call ((StandardErrorListener)factory.getErrorListener()).setErrorOutput(xxx) to redirect the output to stream xxx
(c) use Java facilities to redirect System.err to somewhere else
(d) work out where System.err is going - it might be some log file somewhere.
(e) change your application to display System.err in a window somewhere.


Michael Kay

From: Jan Kovařík []
Sent: 25 June 2009 11:34
Subject: [saxon] error messages


i have this little problem. I cannot find the way how to find out, where is the error description, when im trying to compile malformed stylesheet. I get only TransformerConfigurationException and from any of its methods or parameters, i cannot get what i need, the message like this:

Error at xsl:template on line 5 of file:/C:/all/aa.xsl:
  Error in _expression_ {/html/body/a[@name='key']/following-sibling::table[1]}: Axis in pattern must
be child or attribute

that tells me where i can find the error. Only thing i can get is

Failed to compile stylesheet. 1 error detected.

Is there any exception that tells me that?

Any help would be appreciated.

Jan Kovařík