Package net.sf.saxon.trans
Class XmlProcessingException
java.lang.Object
net.sf.saxon.trans.XmlProcessingException
- All Implemented Interfaces:
- XmlProcessingError
The XmlProcessingException class is a concrete implementation of the 
XmlProcessingError
 interface that wraps an XPathException object.- 
Constructor SummaryConstructorsConstructorDescriptionXmlProcessingException(XPathException exception) Create an XmlProcessingException wrapping an XPathException
- 
Method SummaryModifier and TypeMethodDescriptionReturn an XmlProcessingError containing the same information, but to be treated as a warning conditiongetCause()Return an underlying exception.Get the error code, as a QName.Get the Expression that failed, if knownGet the location information associated with the errorGet the error message associated with this errorgetPath()Get the absolute XPath expression that identifies the node within its document where the error occurred, if availableAsk whether this error is to be treated as fatal, and if so, return the relevant messsageGet the wrapped exceptionbooleanAsk whether this static error has already been reportedbooleanAsk whether this is a static error, defined as an error that can be detected during static analysis of a stylesheet, query, schema, or XPath expression.booleanAsk whether this is a type error.booleanAsk whether this error is being reported as a warning condition.voidsetAlreadyReported(boolean reported) Say whether this error has already been reportedvoidsetTerminationMessage(String message) Indicate that this error is to be treated as fatal; that is, execution will be abandoned after reporting this error.voidsetWarning(boolean warning) Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.sf.saxon.s9api.XmlProcessingErrorgetModuleUri
- 
Constructor Details- 
XmlProcessingExceptionCreate an XmlProcessingException wrapping an XPathException- Parameters:
- exception- the wrapped exception
 
 
- 
- 
Method Details- 
getXPathExceptionGet the wrapped exception- Returns:
- the wrapped exception
 
- 
getHostLanguage- Specified by:
- getHostLanguagein interface- XmlProcessingError
 
- 
isStaticErrorpublic boolean isStaticError()Description copied from interface:XmlProcessingErrorAsk whether this is a static error, defined as an error that can be detected during static analysis of a stylesheet, query, schema, or XPath expression.- Specified by:
- isStaticErrorin interface- XmlProcessingError
- Returns:
- true if this is a static error
 
- 
isTypeErrorpublic boolean isTypeError()Description copied from interface:XmlProcessingErrorAsk whether this is a type error. Saxon reports type errors statically if it can establish that a supplied value will never satisfy the required type- Specified by:
- isTypeErrorin interface- XmlProcessingError
- Returns:
- true if this is a type error
 
- 
getErrorCodeDescription copied from interface:XmlProcessingErrorGet the error code, as a QName. This may be null if no error code has been assigned- Specified by:
- getErrorCodein interface- XmlProcessingError
- Returns:
- QName
 
- 
getMessageDescription copied from interface:XmlProcessingErrorGet the error message associated with this error- Specified by:
- getMessagein interface- XmlProcessingError
- Returns:
- String the error message
 
- 
getLocationDescription copied from interface:XmlProcessingErrorGet the location information associated with the error- Specified by:
- getLocationin interface- XmlProcessingError
- Returns:
- the location of the error. The result is never null, though it may be a location with little useful information.
 
- 
isWarningpublic boolean isWarning()Description copied from interface:XmlProcessingErrorAsk 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.- Specified by:
- isWarningin interface- XmlProcessingError
- Returns:
- true if a condition is detected that is not an error according to the language specification, but which may indicate that the query or stylesheet might behave in unexpected ways
 
- 
getPathDescription copied from interface:XmlProcessingErrorGet the absolute XPath expression that identifies the node within its document where the error occurred, if available- Specified by:
- getPathin interface- XmlProcessingError
- Returns:
- a path expression identifying the location of the error within an XML document, or null if the information is not available
 
- 
getCauseDescription copied from interface:XmlProcessingErrorReturn an underlying exception. For example, if the static error was caused by failure to retrieve another stylesheet or query module, this may contain the IO exception that was reported; or if the XML parser was unable to parse a stylesheet module, it may contain a SAXException reported by the parser.- Specified by:
- getCausein interface- XmlProcessingError
- Returns:
- the underlying exception if there was one, or null otherwise
 
- 
getFailingExpressionDescription copied from interface:XmlProcessingErrorGet the Expression that failed, if known- Specified by:
- getFailingExpressionin interface- XmlProcessingError
- Returns:
- the failing expression, or null
 
- 
setWarningpublic void setWarning(boolean warning) 
- 
asWarningDescription copied from interface:XmlProcessingErrorReturn an XmlProcessingError containing the same information, but to be treated as a warning condition- Specified by:
- asWarningin interface- XmlProcessingError
- Returns:
- an XmlProcessingError to be treated as a warning
 
- 
setTerminationMessageIndicate that this error is to be treated as fatal; that is, execution will be abandoned after reporting this error. This method may be called by anErrorReporter, 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. If a dynamic error is marked as fatal, it will generally not be caught by any try/catch mechanism within the stylesheet or query.- Specified by:
- setTerminationMessagein interface- XmlProcessingError
- Parameters:
- message- an error message giving the reason for the fatal error
 
- 
getTerminationMessageAsk whether this error is to be treated as fatal, and if so, return the relevant messsage- Specified by:
- getTerminationMessagein interface- XmlProcessingError
- Returns:
- a non-null message if the error has been marked as a fatal error.
 
- 
isAlreadyReportedpublic boolean isAlreadyReported()Ask whether this static error has already been reported- Specified by:
- isAlreadyReportedin interface- XmlProcessingError
- Returns:
- true if the error has already been reported
 
- 
setAlreadyReportedpublic void setAlreadyReported(boolean reported) Say whether this error has already been reported- Specified by:
- setAlreadyReportedin interface- XmlProcessingError
- Parameters:
- reported- true if the error has been reported
 
 
-