@FunctionalInterface
public interface ErrorReporter
The error or warning is reported in the form of an XmlProcessingError
;
unlike the JAXP ErrorListener
and ErrorHandler
it is possible
to report errors without expensively construction an exception object.
The ErrorReporter
's accept()
method does not throw any checked
exceptions. It may however, throw an UncheckedXPathException
indicating
that processing is to be terminated without looking for further errors.
A warning condition is notified using an XmlProcessingError
object whose isWarning()
property is true.
Modifier and Type | Method and Description |
---|---|
void |
report(XmlProcessingError error)
Report an error.
|
void report(XmlProcessingError error)
The application can safely ignore the error if XmlProcessingError.isWarning()
returns true.
The application can indicate to Saxon that the error should be considered fatal
by calling StaticError.setFatal(String)
. The precise effect of marking
an error as fatal is not defined, and may depend on the circumstances; in some cases
it may have no effect. If a dynamic error is marked as fatal then an attempt to
catch the error using a try/catch construct in XSLT or XQuery will generally be
unsuccessful.
error
- details of the error to be reportedCopyright (c) 2004-2021 Saxonica Limited. All rights reserved.