You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "D Gardner (JIRA)" <xa...@xml.apache.org> on 2006/01/23 15:03:09 UTC

[jira] Created: (XALANJ-2262) Exceptions from Error Listener Are Ignored

Exceptions from Error Listener Are Ignored
------------------------------------------

         Key: XALANJ-2262
         URL: http://issues.apache.org/jira/browse/XALANJ-2262
     Project: XalanJ2
        Type: Bug
  Components: XSLTC  
    Versions: 2.7    
 Environment: Windows XP, Sun JDK 1.4.2
    Reporter: D Gardner


In interpretive Xalan, exceptions thrown from the error listener configured
using the Transformer.setErrorListener() method are reported as fatal
errors and processing stops. In XSLTC, these exceptions are simply
swallowed up.

I have a stylesheet that is used to "validate" an XML file. When a validation
error is detected, xsl:message is used to report the error. The error is
passed to a cusom error listener as a warning, but the warning() method
will throw an exception to indicate that the XML file has failed a validation.
Xalan will see this exception, pass it to ErrorListener.fatalError() and then
terminate, but XSLTC just ignores the exception (see the "displayMessage()"
method in the an inner class of: org.apache.xalan.xsltc.trax.TransformerImpl.

According to the TRAX API documentation for  javax.xml.transform.ErrorListener,
it is up to the application to decide if processing should continue when a
warning is reported. Processing should terminate if the "warning()" method
throws an exception but continue if it does not throw an exception. As XSLTC
always continues and ignores the exception, it does not conform to the TRAX
API.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


[jira] Commented: (XALANJ-2262) Exceptions from Error Listener Are Ignored

Posted by "Brian Minchau (JIRA)" <xa...@xml.apache.org>.
    [ http://issues.apache.org/jira/browse/XALANJ-2262?page=comments#action_12420680 ] 

Brian Minchau commented on XALANJ-2262:
---------------------------------------

The code in displayMessage() catches the exception from the user's ErrorListener and ignores it. The right behavior is to throw the exception from the ErrorListener.

Brian Minchau agreed to look a quick fix for this one.

Triaged July 11, 2006.

> Exceptions from Error Listener Are Ignored
> ------------------------------------------
>
>          Key: XALANJ-2262
>          URL: http://issues.apache.org/jira/browse/XALANJ-2262
>      Project: XalanJ2
>         Type: Bug

>   Components: XSLTC
>     Versions: 2.7
>  Environment: Windows XP, Sun JDK 1.4.2
>     Reporter: D Gardner

>
> In interpretive Xalan, exceptions thrown from the error listener configured
> using the Transformer.setErrorListener() method are reported as fatal
> errors and processing stops. In XSLTC, these exceptions are simply
> swallowed up.
> I have a stylesheet that is used to "validate" an XML file. When a validation
> error is detected, xsl:message is used to report the error. The error is
> passed to a cusom error listener as a warning, but the warning() method
> will throw an exception to indicate that the XML file has failed a validation.
> Xalan will see this exception, pass it to ErrorListener.fatalError() and then
> terminate, but XSLTC just ignores the exception (see the "displayMessage()"
> method in the an inner class of: org.apache.xalan.xsltc.trax.TransformerImpl.
> According to the TRAX API documentation for  javax.xml.transform.ErrorListener,
> it is up to the application to decide if processing should continue when a
> warning is reported. Processing should terminate if the "warning()" method
> throws an exception but continue if it does not throw an exception. As XSLTC
> always continues and ignores the exception, it does not conform to the TRAX
> API.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org