com.icl.saxon

Class StandardErrorListener

public class StandardErrorListener extends Object implements ErrorListener

StandardErrorListener is the standard error handler for XSLT processing errors, used if no other ErrorListener is nominated.

Author: Michael H. Kay

Field Summary
PrintStreamerrorOutput
intrecoveryPolicy
intwarningCount
Method Summary
voiderror(TransformerException exception)
Receive notification of a recoverable error.
voidfatalError(TransformerException exception)
Receive notification of a non-recoverable error.
static StringgetExpandedMessage(TransformerException err)
Get a string containing the message for this exception and all contained exceptions
static StringgetLocationMessage(TransformerException err)
Get a string identifying the location of an error.
voidsetErrorOutput(PrintStream writer)
Set output destination for error messages (default is System.err)
voidsetRecoveryPolicy(int policy)
Set the recovery policy
voidwarning(TransformerException exception)
Receive notification of a warning.

Field Detail

errorOutput

PrintStream errorOutput

recoveryPolicy

int recoveryPolicy

warningCount

int warningCount

Method Detail

error

public void error(TransformerException exception)
Receive notification of a recoverable error.

The transformer must continue to provide normal parsing events after invoking this method. It should still be possible for the application to process the document through to the end.

The action of the standard error listener depends on the recovery policy that has been set, which may be one of RECOVER_SILENTLY, RECOVER_WITH_WARNING, or DO_NOT_RECOVER

Parameters: exception The error information encapsulated in a transformer exception.

Throws: javax.xml.transform.TransformerException if the application chooses to discontinue the transformation.

See Also: javax.xml.transform.TransformerException

fatalError

public void fatalError(TransformerException exception)
Receive notification of a non-recoverable error.

The application must assume that the transformation cannot continue after the Transformer has invoked this method, and should continue (if at all) only to collect addition error messages. In fact, Transformers are free to stop reporting events once this method has been invoked.

Parameters: exception The error information encapsulated in a transformer exception.

Throws: javax.xml.transform.TransformerException if the application chooses to discontinue the transformation.

See Also: javax.xml.transform.TransformerException

getExpandedMessage

public static String getExpandedMessage(TransformerException err)
Get a string containing the message for this exception and all contained exceptions

getLocationMessage

public static String getLocationMessage(TransformerException err)
Get a string identifying the location of an error.

setErrorOutput

public void setErrorOutput(PrintStream writer)
Set output destination for error messages (default is System.err)

Parameters: writer The PrintStream to use for error messages

setRecoveryPolicy

public void setRecoveryPolicy(int policy)
Set the recovery policy

warning

public void warning(TransformerException exception)
Receive notification of a warning.

Transformers can use this method to report conditions that are not errors or fatal errors. The default behaviour is to take no action.

After invoking this method, the Transformer must continue with the transformation. It should still be possible for the application to process the document through to the end.

Parameters: exception The warning information encapsulated in a transformer exception.

Throws: javax.xml.transform.TransformerException if the application chooses to discontinue the transformation.

See Also: javax.xml.transform.TransformerException