Saxon.Api

 

 

Saxon.Api

Class SaxonApiException


public class SaxonApiException
extends Exception

The SaxonApiException class contains information about a static or dynamic error detected during compilation or evaluation of a stylesheet, query, or XPath expression, or other errors that occur when using the Saxon API.

Constructor Summary

SaxonApiException (Exception err)

Construct a SaxonApiException wrapping another exception (often an XPathException)

SaxonApiException (string message)

Construct a SaxonApiException with a given message (and no error code)

SaxonApiException (string message, Exception err)

Construct a SaxonApiException with a given message, supplying an underlying exception as the cause

 

Property Summary

 int ColumnNumber

The column number locating the error (typically within a query or stylesheet module).

 QName ErrorCode

The error code, as a QName. May be null if no error code has been assigned.

 string InnerMessage

Return the message associated with this error concatenated with the message from the causing exception.

 bool IsTypeError

Indicate whether this condition is a type error.

 bool IsWarning

Indicate whether this error is being reported as a warning condition. If so, applications may ignore the condition, though the results may not be as intended.

 int LineNumber

The line number locating the error within a query or stylesheet module.

 string Message

Return the message associated with this error.

 string ModuleUri

The URI of the query or stylesheet module in which the error was detected (as a string).

 net.sf.saxon.trans.XPathException UnderlyingException

Return the underlying exception. This is unstable as this is an internal object.

 

Method Summary

 string ToString ()

Return the error message.

 

Constructor Detail

SaxonApiException

public SaxonApiException(Exception err)

Construct a SaxonApiException wrapping another exception (often an XPathException)

Parameters:

err - the exception to be wrapped

SaxonApiException

public SaxonApiException(string message)

Construct a SaxonApiException with a given message (and no error code)

Parameters:

message - The message to be associated with the exception

SaxonApiException

public SaxonApiException(string message,
                         Exception err)

Construct a SaxonApiException with a given message, supplying an underlying exception as the cause

Parameters:

message - The exception message
err - The underlying cause of the exception

Property Detail

ColumnNumber

public int ColumnNumber {get; }

The column number locating the error (typically within a query or stylesheet module).

May be set to -1 if the location of the error is unknown.

ErrorCode

public QName ErrorCode {get; }

The error code, as a QName. May be null if no error code has been assigned.

InnerMessage

public string InnerMessage {get; }

Return the message associated with this error concatenated with the message from the causing exception.

IsTypeError

public bool IsTypeError {get; }

Indicate whether this condition is a type error.

IsWarning

public bool IsWarning {get; set; }

Indicate whether this error is being reported as a warning condition. If so, applications may ignore the condition, though the results may not be as intended.

LineNumber

public int LineNumber {get; }

The line number locating the error within a query or stylesheet module.

May be set to -1 if the location of the error is unknown.

Message

public override string Message {get; }

Return the message associated with this error.

Returns:

The exception message

ModuleUri

public string ModuleUri {get; }

The URI of the query or stylesheet module in which the error was detected (as a string).

May be null if the location of the error is unknown, or if the error is not localized to a specific module, or if the module in question has no known URI (for example, if it was supplied as an anonymous Stream).

UnderlyingException

public net.sf.saxon.trans.XPathException UnderlyingException {get; }

Return the underlying exception. This is unstable as this is an internal object.

Returns:

The underlying XPathException

Method Detail

ToString

public override string ToString()

Return the error message.