O.K. I created an OSGI bundle which wrapped Saxon’s TransformerFactoryImpl class. In the OSGI implementation, I included the class files expanded from the saxhon9he jar.
I got the same result. I was not able to set Camel’s transformerFactory or transformerFactoryClass to my implementation any better than I was able to point it to the servicemix-saxon or camel-saxon bundles. There are no errors, but the result is that the converted message has a prolog and nothing else. This is the same effect I get in standalone camel (2.9.0) if I have a xalan jar file anywhere on my build path. If you have this working, may I ask what version of Camel and Servicemix you are using, and whether or not you have a xalan-2.7.1 jar in ./lib/endorsed/ ? Thanks, Frank. From: Nowakowski, Mateusz-2 [via Camel] [mailto:ml-node+s465427n571498...@n5.nabble.com] Sent: Sunday, June 24, 2012 7:34 AM To: Fleishaker, Frank Subject: RE: camel xslt 2.0 support > I made the following change to ./etc/system.properties: I don't recommend changing ./etc/system.properties to Saxon because it won't work honestly. Saxon (xslt2 implementation) is a bundle and is loaded just before camel-saxon but it doesn't matter, "javax.xml.transform.TransformerFactory" won't see saxon because it is on system classloader and system classloader don't see bundles classloaders. The only proper way to use saxon is to ... create net.sf.saxon.TransformerFactoryImpl myself in the blueprint/or spring dm and provide it via "transformerFactory" parameter in camel. Secondly when you use Saxon you need to be aware: that saxon works better when you work on Saxon data format (NodeInfo/DocumentInfo) and your all xslts use the same Saxon transformer factory instance. So in my app I have one bundle which exports transformer factory OSGI service and I inject the same service instance where I need. (I have own Camel xslt and xpaths endpoint as well, because Camel one doesn't support working on Saxon native data format and so you can consider having own xslt/xpath camel endpoint as well and solve this issue there). PS. You can try to.. copy Saxon jar to ./lib But there is nice readme.txt: "This directory is the standard Java classpath directory. Any jar in this folder will be part of the main classloader used to load Karaf. However, in OSGi, classes defined in these jars won't be available to other bundles unless one of the org.osgi.framework.system.packages.extra or org.osgi.framework.bootdelegation properties in the etc/config.properties file is modified to export or delegate the packages. Please refer to the OSGi Core Specification for more information on these properties and the OSGi classloading mechanism." But I don't recommend touching this dir until it is your last resort, because this is a hack and you can't control how the rest smx bundles are configured. -- Regards, Mateusz Nowakowski -----Original Message----- From: Claus Ibsen [mailto:[hidden email]</user/SendEmail.jtp?type=node&node=5714988&i=0>] Sent: Sunday, June 24, 2012 09:49 To: [hidden email]</user/SendEmail.jtp?type=node&node=5714988&i=1> Subject: Re: camel xslt 2.0 support Hi You can try upgrading SMX. On Fri, Jun 22, 2012 at 6:46 PM, weather99 <[hidden email]</user/SendEmail.jtp?type=node&node=5714988&i=2>> wrote: > I tried installing camel-saxon but got the same results. > > I made the following change to ./etc/system.properties: > #javax.xml.transform.TransformerFactory=org.apache.xalan.processor.Tra > nsformerFactoryImpl > javax.xml.transform.TransformerFactory=net.sf.saxon.TransformerFactory > Impl > > This also had no effect. I'm still at the same place. My camel xslt > 2.0 transform returns prolog only. When using a bean xslt 2.0 > transformer the bean returns errors for xslt 2.0 tags. Removing the > xalan-2.7.1.jar from ./ib/endorsed causes my route to fail to load. > > I have no problem getting this to work in standalone Camel. I have > been able to duplicate the problem in standalone Camel by putting a > xalan jar file on my classpath. In that case, the Camel xslt > transformer gives me a prolog only. > > > > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/camel-xslt-2-0-support-tp5646214p571 > 4932.html Sent from the Camel - Users mailing list archive at > Nabble.com. -- Claus Ibsen ----------------- FuseSource Email: [hidden email]</user/SendEmail.jtp?type=node&node=5714988&i=3> Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen ________________________________ If you reply to this email, your message will be added to the discussion below: http://camel.465427.n5.nabble.com/camel-xslt-2-0-support-tp5646214p5714988.html To unsubscribe from camel xslt 2.0 support, click here<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5646214&code=ZmZsZWlzaGFAaGFycmlzLmNvbXw1NjQ2MjE0fC0yNzQ2NjQ0MTQ=>. NAML<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> -- View this message in context: http://camel.465427.n5.nabble.com/camel-xslt-2-0-support-tp5646214p5715130.html Sent from the Camel - Users mailing list archive at Nabble.com.