Uploaded image for project: 'XalanJ2'
  1. XalanJ2
  2. XALANJ-2376

TransformerFactory.newTransformer(source) returns null instead throwing an exception

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Blocker
    • Resolution: Unresolved
    • 2.7
    • None
    • transformation
    • None
    • According to the spec newTransformer() should not return null. That the case with 2.6.0 but not with 2.7.0
    • PatchAvailable

    Description

      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)

      Attachments

        1. patch.txt
          0.5 kB
          Jean-Frederic Clere

        Activity

          People

            Unassigned Unassigned
            jfclere Jean-Frederic Clere
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: