[jira] [Commented] (XALANJ-2376) TransformerFactory.newTransformer(source) returns null instead throwing an exception
"Joe Kesselman (Jira)" <[email protected]>
| Newsgroups | gmane.text.xml.xalan.devel |
|---|---|
| Message-ID | <[email protected]> |
[ https://issues.apache.org/jira/browse/XALANJ-2376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18014456#comment-18014456 ]
Joe Kesselman commented on XALANJ-2376:
---------------------------------------
I believe we considered putting a default ErrorListener on our TransformerFactoryImpl implementations. I don't recall the outcome of that discussion.
xsltc.trax.TransformerFactoryImpl is its own default listener (just printing to System.err)
I'm not seeing a default in the xsltc SmartTranformerFactoryImpl
xalan.processor.TransformerFactoryImpl inherits its initialization behavior from the javax SAXTransformerFactory.
> TransformerFactory.newTransformer(source) returns null instead throwing an exception
> ------------------------------------------------------------------------------------
>
> Key: XALANJ-2376
> URL: https://issues.apache.org/jira/browse/XALANJ-2376
> Project: XalanJ2
> Issue Type: Bug
> Components: transformation
> Affects Versions: 2.7
> Environment: According to the spec newTransformer() should not return null. That the case with 2.6.0 but not with 2.7.0
> Reporter: Jean-Frederic Clere
> Priority: Blocker
> Attachments: patch.txt
>
>
> The following code:
> +++
> System.out.println("TransformerFactory: " + tf);
> Transformer t = tf.newTransformer(source);
> System.out.println("Transformer: " + t + " Source: " + source);
> t.transform(source, doc);
> } catch (Exception ex) {
> ex.printStackTrace();
> }
> +++
> throws a null java.lang.NullPointerException with 2.7.0 (at t.transform(source, doc);) and a org.xml.sax.SAXParseException (at Transformer t = tf.newTransformer(source);) in 2.6.0
> The problem is located in src/org/apache/xalan/processor/TransformerFactoryImpl.java m_errorListener is wrongly initialized to DefaultErrorHandler(false)
--
This message was sent by Atlassian Jira
(v8.20.10#820010)