You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Morris Kwan (JIRA)" <xa...@xml.apache.org> on 2005/06/30 15:55:57 UTC

[jira] Resolved: (XALANJ-1171) TCK: Error should be reported to System.err if there is no registered ErrorListener

     [ http://issues.apache.org/jira/browse/XALANJ-1171?page=all ]
     
Morris Kwan resolved XALANJ-1171:
---------------------------------

    Fix Version: CurrentCVS
     Resolution: Fixed
      Assign To:     (was: Xalan Developers Mailing List)

This one was fixed during the JAXP 1.3 integration.

> TCK: Error should be reported to System.err if there is no registered ErrorListener
> -----------------------------------------------------------------------------------
>
>          Key: XALANJ-1171
>          URL: http://issues.apache.org/jira/browse/XALANJ-1171
>      Project: XalanJ2
>         Type: Bug
>   Components: transformation, Xalan-interpretive
>     Versions: CurrentCVS
>  Environment: Operating System: All
> Platform: All
>     Reporter: Morris Kwan
>      Fix For: CurrentCVS

>
> The Javadoc for ErrorListener says:
> For transformation errors, a Transformer must use this interface instead of 
> throwing an exception: it is up to the application to decide whether to throw 
> an exception for different types of errors and warnings. 
> If an application does not register an ErrorListener, errors are reported to 
> System.err.
> Code to demonstrate the problem:
> import javax.xml.transform.*;
> import javax.xml.transform.stream.*;
> import java.io.*;
> public class ErrorListenerTest2
> {
>    // xsl:template has an invalid attribute (a='1').
>    private static String XSL1 = "<xsl:stylesheet version='1.0' 
> xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>"
>                                + "<xsl:template a='1' match='/'>"
>                                + "<H1><xsl:value-of select='//title'/></H1>"
>                                + "</xsl:template>"
>                                + "</xsl:stylesheet>";
>                                
>    public static void main(String[] args)
>    {
>         StreamSource source = new StreamSource(new StringReader(XSL1));
>         
>         try {
>             Transformer transformer = TransformerFactory.newInstance
> ().newTransformer(source);
>         } 
>         catch (TransformerException e) {
>             System.out.println("Error: TransformerException is thrown");
>             System.out.println(e);
>         }
>     }
> }
> Current output:
> Error: TransformerException is thrown
> javax.xml.transform.TransformerConfigurationException: javax.xml.transform.Trans
> formerConfigurationException: javax.xml.transform.TransformerException: javax.xm
> l.transform.TransformerException: "a" attribute is not allowed on the xsl:templa
> te element!
> The expected behavior is that there is no TransformerException thrown, and the 
> error is reported to System.err. You should not see the line "Error: 
> TransformerException is thrown". Only the error message is displayed.

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