Uploaded image for project: 'JBoss Modules'
  1. JBoss Modules
  2. MODULES-205

newTransformerHandler ignores provided XSLT source

XMLWordPrintable

    • Hide

      1. Create a new instance of a TransformerFactory using javax.xml.transform.TransformerFactory.newInstance();
      2. Create a transformerHandler using factory.newTransformerHandler(new StreamSource(xsltFile));
      3. Execute the transformation: handler.getTransformer().transform(source, result);
      4. Only identity transformation will be applied.

      Show
      1. Create a new instance of a TransformerFactory using javax.xml.transform.TransformerFactory.newInstance(); 2. Create a transformerHandler using factory.newTransformerHandler(new StreamSource(xsltFile)); 3. Execute the transformation: handler.getTransformer().transform(source, result); 4. Only identity transformation will be applied.

      I recently migrated from JBoss AS 4.2 to Wildfly 8. In my application, I used to marshal some data to XML and apply two distinct XSLT transformations to the output. I realised this using two TransformerHandlers and a SAXResult which passes the results of the first transformation to the second one.
      Long story short, after the migration, the transformations weren't executed anymore, and after debugging I found out that only identity transformations were applied. I tracked this down to a line in 'jboss-modules/src/main/java/_redirected/_TransformerFactory.java'. The factory method to create a new TransformerHandler using a Source does not pass the Source object to the handler, causing an identity transformation to be created.

              dlloyd@redhat.com David Lloyd
              heerdegen Florian Heerdegen (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: