I am using JDK7 and Fuse 6.1.0.redhat-379.
My route is a simple get from URI, then XSLT and save to File. For instance:
<from uri="direct:start" />
<to uri="http4://www.example.com" />
<to uri="xslt:com/playground/poc/transform.xsl" />
<to uri="file:work?fileName=output.xml" />
I faced the exact problem as mentioned in Apache Camel website, XSLT component section (link). An excerpt:
Here are some observations from Sameer, a Camel user, which he kindly shared with us:
In case anybody faces issues with the XSLT endpoint please review these points.
I was trying to use an xslt endpoint for a simple transformation from one xml to another using a simple xsl. The output xml kept appearing (after the xslt processor in the route) with outermost xml tag with no content within.
No explanations show up in the DEBUG logs. On the TRACE logs however I did find some error/warning indicating that the XMLConverter bean could no be initialized.
After a few hours of cranking my mind, I had to do the following to get it to work (thanks to some posts on the users forum that gave some clue):
1. Use the transformerFactory option in the route
tFactorybean having bean defined in the spring context for
2. Added the Xalan jar into my maven pom.
I followed the steps but when I started the bundle, this exception appeared:
ERROR: Bundle eip  EventDispatcher: Error during dispatch. (java.lang.NoClassDefFoundError: org/apache/xalan/xsltc/compiler/Parser)
I suspect it is something to do with the OSGI dependencies that I might have missed out installing. Has anyone also encountered this and could advise?
EDIT: I've installed the servicemix dependencies that are OSGI compliant - bcel and xalan. Still, the same exception occurs when I start my bundle.
EDIT: I've found another way to get it working by using saxon instead of xalan. Simply, inject this bean
<bean id="transformerFactory" class="net.sf.saxon.TransformerFactoryImpl" />
into the XSLT routing endpoint.
<to uri="xslt:com/playground/poc/transform.xsl?transformerFactory=transformerFactory" />
Hope this helps!