You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Alex Fuller (JIRA)" <xa...@xml.apache.org> on 2005/06/28 18:21:01 UTC

[jira] Commented: (XALANJ-1770) xalan transformation does not transfer control to registered error listsner in some cases

    [ http://issues.apache.org/jira/browse/XALANJ-1770?page=comments#action_12314619 ] 

Alex Fuller commented on XALANJ-1770:
-------------------------------------

Using version 2.5.2 (not sure about 2.6.0 yet) I have an identity transformation in its own thread and outputting to a StreamResult (wrapping a PipedOutputStream).  That transformation has an assigned ErrorListener.  

In another thread I have a SAX Parser that is working on the transformation's result (via a PipedInputStream).  The SAX parser throws a fatal error based on business logic and via a synchronized method informs the transformation's ErrorListener that its output is about to close.  The SAX parser then shuts down and throws the exception, closing the stream in the process.  The transformer sees that it's output stream has been closed and throws an exception to this effect.  If it used the ErrorListener, it would see that a "downstream" error has occured and the exception should be consumed and the transformation terminated.  However, the ErrorListener is never consulted and the exception is thrown.  One can see this via print statements.  

The fun part is that if, instead of using an identity transformation, you provide an XSLT that does nothing but an <xsl:copy-of select="."/> to the inputted XML, it will use the ErrorListener. 

> xalan transformation does not transfer control to registered error listsner in some cases
> -----------------------------------------------------------------------------------------
>
>          Key: XALANJ-1770
>          URL: http://issues.apache.org/jira/browse/XALANJ-1770
>      Project: XalanJ2
>         Type: Bug
>   Components: transformation, Xalan-interpretive
>     Versions: 2.0.0
>  Environment: Operating System: Windows NT/2K
> Platform: PC
>     Reporter: Vishwajit Pantvaidya
>     Assignee: Xalan Developers Mailing List

>
> I am using jaxp api in my xslt trandformation code and running with xalan 2.0.0.
> I developed and then registered my own error listener with the
> TransformerFactory and the Transformer. In some cases, I am finding that this
> error listener is not getting called at all.
> For example, in one case while testing the error listener getting called for
> problems during xsl file compilation, my xsl file had a line <xsl:value-of
> select = "/CxQuoteContainer/containerInfo/attribute/atomicValue[]"/>. In this
> case, the following exception was thrown bypassing the error handler:
> javax.xml.transform.TransformerException: java.lang.NullPointerException
>         at org.apache.xalan.transformer.TransformerImpl.transformNode(Transforme
> rImpl.java, Compiled Code)
>         at org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java
> :2894)
>         at java.lang.Thread.run(Thread.java:479)
> The strange thing is that the above stack trace does not contain any entries
> pointing to my code.
> In another case, to test error listener with transformation errors, I added a
> the specification <!DOCTYPE EOM_SLTC_ORDER> to my xml string without a
> corresponding root element. There again the following errors were flagged, but
> the registered listener was bypassed (and the transformation completed as it
> should have):
> [Error] :1:44: Document root element "CxQuoteContainer", must match DOCTYPE root
>  "EOM_SLTC_ORDER".
> [Error] :1:44: Element type "CxQuoteContainer" must be declared.
> ...

-- 
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