Saxon.Api

 

 

Saxon.Api

Class Error


public class Error

The Saxon.Api.Error class contains information about an error detected during compilation or execution of a stylesheet, query, XPath expression, or schema. Note that this class is not an exception (though in some cases it may wrap an exception); errors in schemas or stylesheets are considered as normal events and do not cause termination of processing, so they are not delivered as exceptions.

The constructor for this class is internal; instances of this class can be created internally by SaxonCS, but not by user application code.

Property Summary

 Exception Cause

The underlying cause. This many be null.

 QName ErrorCode

The error code (if any)

 HostLanguage HostLanguage

Property to get the host language where this error originates from.

 bool IsAlreadyReported

Property indicating whether this static error has already been reported.

 bool IsStaticError

Property to check if this error is a StaticError.

 bool IsTypeError

Property which indicates whether this condition is a type error.

 bool IsWarning

This property indicates whether the error is to be treated as a warning condition.

 Location Location

The location of the error (typically identifying a module of a schema, query, or stylesheet, and a line and column number within that module).

 string Message

The error message

 string TerminationMessage

Property to indicate that this error is to be treated as fatal, and if so, to supply a message that will be used on termination. Execution will be abandoned after reporting this error. This method may be called by an ErrorReporter, for example if the error is considered so severe that further processing is not worthwhile, or if too many errors have been signalled. There is no absolute guarantee that setting this property will cause execution to be abandoned. The property can also be used to ask whether this error is to be treated as fatal.

 

Method Summary

 Error AsWarning ()

Return an equivalent error condition, to be treated as a warning. The original error is not changed.

 

Property Detail

Cause

public Exception Cause {get; }

The underlying cause. This many be null.

ErrorCode

public QName ErrorCode {get; }

The error code (if any)

HostLanguage

public HostLanguage HostLanguage {get; }

Property to get the host language where this error originates from.

IsAlreadyReported

public bool IsAlreadyReported {get; set; }

Property indicating whether this static error has already been reported.

IsStaticError

public bool IsStaticError {get; }

Property to check if this error is a StaticError.

IsTypeError

public bool IsTypeError {get; }

Property which indicates whether this condition is a type error.

IsWarning

public bool IsWarning {get; }

This property indicates whether the error is to be treated as a warning condition.

Location

public Location Location {get; }

The location of the error (typically identifying a module of a schema, query, or stylesheet, and a line and column number within that module).

Message

public string Message {get; }

The error message

TerminationMessage

public string TerminationMessage {get; set; }

Property to indicate that this error is to be treated as fatal, and if so, to supply a message that will be used on termination. Execution will be abandoned after reporting this error. This method may be called by an ErrorReporter, for example if the error is considered so severe that further processing is not worthwhile, or if too many errors have been signalled. There is no absolute guarantee that setting this property will cause execution to be abandoned. The property can also be used to ask whether this error is to be treated as fatal.

Method Detail

AsWarning

public Error AsWarning()

Return an equivalent error condition, to be treated as a warning. The original error is not changed.