You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by pchakinala <pr...@planetsoft.com> on 2012/04/17 12:24:19 UTC
camel xslt 2.0 support
Hi,
we are using camel-xslt component for xml transformation and xslt version is
2.0. Below route definition is working fine with servicemix 4.3.
<route>
<from uri="jetty:http://0.0.0.0:8192/httpRepreq/"/>
<to uri="xslt:car-response1.xsl"/>
<to
uri="http://localhost:8080/jsp-examples/checkbox/mefACK.jsp?bridgeEndpoint=true"/>
</route>
However we require xslt 2.0 support for that i have changed uri like below
in the route definition.
After modifing the definition found below error at the time of bundle
deployment
<to uri="xslt:car-response1.xsl?transformerFactory=tFactory"/>
Error:
admin@root>Exception in thread "SpringOsgiExtenderThread-18"
org.apache.camel.RuntimeCamelException:
org.apache.camel.FailedToCreateRouteException: Fa
iled to create route route5 at: >>>
To[xslt:car-response1.xsl?transformerFactory=tFactory] <<< in route:
Route[[From[jetty:http://0.0.0.0:8192/httpRep
req/]] -> [conv... because of Failed to resolve endpoint:
xslt://car-response1.xsl?transformerFactory=tFactory due to: Could not
compile stylesheet cl
ass path resource [car-response1.xsl]
at
org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1164)
at
org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:117)
at
org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:240)
at
org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:97)
at
org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:303)
at
org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:911)
at
org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext.finishRefresh(AbstractOsgiBundleApplicationContext.java:235)
at
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.ja
va:358)
at
org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
at
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplication
Context.java:320)
at
org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(Dependen
cyWaiterApplicationContextExecutor.java:132)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create
route route5 at: >>> To[xslt:car-response1.xsl?transformerFactory=tFactory]
<<< in route: Route[[From[jetty:http://0.0.0.0:8192/httpRepreq/]] ->
[conv... because of Failed to resolve endpoint:
xslt://car-response1.xsl?transfo
rmerFactory=tFactory due to: Could not compile stylesheet class path
resource [car-response1.xsl]
at
org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:820)
at
org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:165)
at
org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:697)
at
org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1665)
at
org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1452)
at
org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1349)
at
org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.java:176)
at
org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:67)
at
org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:54)
at
org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1317)
at
org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:221)
at
org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:115)
... 10 more
Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to
resolve endpoint: xslt://car-response1.xsl?transformerFactory=tFactory due
to: C
ould not compile stylesheet class path resource [car-response1.xsl]
at
org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:443)
at
org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:48)
at
org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:180)
at
org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:110)
at
org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:116)
at
org.apache.camel.model.SendDefinition.resolveEndpoint(SendDefinition.java:61)
at
org.apache.camel.model.SendDefinition.createProcessor(SendDefinition.java:55)
at
org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:437)
at
org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:183)
at
org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:817)
... 21 more
Caused by: javax.xml.transform.TransformerConfigurationException: Could not
compile stylesheet class path resource [car-response1.xsl]
at
org.apache.camel.component.xslt.XsltComponent.loadResource(XsltComponent.java:175)
at
org.apache.camel.component.xslt.XsltComponent.createEndpoint(XsltComponent.java:133)
at
org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:75)
at
org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:425)
... 30 more
Caused by: javax.xml.transform.TransformerConfigurationException: Could not
compile stylesheet
at
org.apache.xalan.xsltc.trax.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:832)
at
org.apache.camel.builder.xml.XsltBuilder.setTransformerSource(XsltBuilder.java:301)
at
org.apache.camel.builder.xml.XsltBuilder.setTransformerInputStream(XsltBuilder.java:331)
at
org.apache.camel.component.xslt.XsltComponent.loadResource(XsltComponent.java:170)
... 33 more
Can you suggest how to configure transformerFactory property? Is this
approach works with XSLT 2.0 Style sheets
thanks
--
View this message in context: http://camel.465427.n5.nabble.com/camel-xslt-2-0-support-tp5646214p5646214.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: camel xslt 2.0 support
Posted by Claus Ibsen <cl...@gmail.com>.
Hi
There is a camel-saxon feature you can install, if using Camel and xslt.
And I think you can see a JVM system property to tell it which xslt
factory to use.
So maybe that can enforce the saxon on a JVM wide level.
On Thu, Jun 21, 2012 at 7:45 PM, weather99 <ff...@harris.com> wrote:
> Despite installing servicemix-saxon, and following the instructions on this
> and other threads, I still cannot get xslt 2.0 to work in Servicemix 4.4.1
> or 4.4.2. The converted message shows up with only the prolog <?xml
> version="1.0" encoding="UTF-8"?>, which indicates an xslt 1.0 conversion was
> done.
>
> I'm using this as part of my route:
> <camel:to
> uri="xslt:file:xsl/my.xsl?transformerFactoryClass=net.sf.saxon.TransformerFactoryImpl"
> />
>
> I have also tried this same thing via. a bean, with the same result:
> <to uri="xslt:file:xsl/my.xsl?transformerFactory=tFactory" /> <bean
> id="tFactory" class="net.sf.saxon.TransformerFactoryImpl" />
>
> In order to troubleshoot further, I embedded the entire xslt transformation
> inside a bean, using the saxon9he jar file. It worked in standalone Camel.
> To make sure I had no external dependencies for the conversion, I built it
> with the extracted classes from the saxon jar. When I tried to run it in
> Servicemix, i got this result:
>
> Line #1; Column #473; "xpath-default-namespace" attribute is not allowed on
> the xsl:stylesheet element!
> SystemId Unknown; Line #55; Column #86; Could not find function: upper-case
>
> This also indicates that only an xslt 1.0 conversion was attempted, since
> the processor doesn't know what to do with these tags. This is the bean I
> was using: <bean ref="xslt20" method="map" />
>
> It appears that in Servicemix, the xalan jar in ./lib/endorsed overrides all
> xslt processing no matter what. I tried removing the xalan-2.7.1.jar from
> that directory. My route wouldn't start, and I got this message:
>
> org.springframework.beans.factory.BeanCreationException: Error creating bean
> with name 'xslt20' defined in URL
> [bundle://187.0:0/META-INF/spring/beans-0.0.0.xml]: Instantiation of bean
> failed; nested exception is
> javax.xml.transform.TransformerFactoryConfigurationError: Provider
> *org.apache.xalan.processor*.TransformerFactoryImpl not found
>
> So it seems that it's always looking for xalan no matter what, which is only
> an xslt 1.0 processor.
>
> Please advise as to what I'm doing wrong. We have a lot invested in xslt
> 2.0 in standalone Camel, and I'm now at a dead-stop trying to deploy it to
> Servicemix.
>
> Thanks.
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/camel-xslt-2-0-support-tp5646214p5714877.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
RE: camel xslt 2.0 support
Posted by weather99 <ff...@harris.com>.
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+s465427n5714988h8@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.
RE: camel xslt 2.0 support
Posted by "Nowakowski, Mateusz" <Ma...@sabre.com>.
> 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:claus.ibsen@gmail.com]
Sent: Sunday, June 24, 2012 09:49
To: users@camel.apache.org
Subject: Re: camel xslt 2.0 support
Hi
You can try upgrading SMX.
On Fri, Jun 22, 2012 at 6:46 PM, weather99 <ff...@harris.com> 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: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
RE: camel xslt 2.0 support
Posted by weather99 <ff...@harris.com>.
Thanks Claus.
I get the same problem in either Servicemix 4.4.1 or 4.4.2.
Remember that I can also get the same problem in standalone Camel, so you might want to take a look at how it loads these classes.
I can have everything working fine in standalone Camel, running against the saxon9he.jar.
All I have to do is add xalan-2.7.1.jar to my build path, and I get the same problem – prolog only in the output.
If I remove the xalan jar, everything works fine again.
In the case of Servicemix, xalan-2.7.1.jar is in the ./lib/endorsed directory, so it is loaded on the bootclasspath ahead of everything else.
I’d like to just get rid of it, but it seems it was added there as a solution to some other problem.
Best Regards,
Frank
From: Claus Ibsen-2 [via Camel] [mailto:ml-node+s465427n5714977h67@n5.nabble.com]
Sent: Sunday, June 24, 2012 3:49 AM
To: Fleishaker, Frank
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=5714977&i=0>> 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.TransformerFactoryImpl
> javax.xml.transform.TransformerFactory=net.sf.saxon.TransformerFactoryImpl
>
> 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-tp5646214p5714932.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
FuseSource
Email: [hidden email]</user/SendEmail.jtp?type=node&node=5714977&i=1>
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-tp5646214p5714977.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-tp5646214p5715118.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: camel xslt 2.0 support
Posted by Claus Ibsen <cl...@gmail.com>.
Hi
You can try upgrading SMX.
On Fri, Jun 22, 2012 at 6:46 PM, weather99 <ff...@harris.com> 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.TransformerFactoryImpl
> javax.xml.transform.TransformerFactory=net.sf.saxon.TransformerFactoryImpl
>
> 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-tp5646214p5714932.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Re: camel xslt 2.0 support
Posted by Raul Kripalani <ra...@fusesource.com>.
Have you checked out all the different possibilities outlined under
http://camel.apache.org/xslt.html to use Saxon?
You can set options on the endpoints or set a JVM property which looks
different from what you're setting.
Regards,
Raúl.
Sent from my iPhone
On 23 Jun 2012, at 08:03, weather99 <ff...@harris.com> 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.TransformerFactoryImpl
> javax.xml.transform.TransformerFactory=net.sf.saxon.TransformerFactoryImpl
>
> 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-tp5646214p5714932.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
RE: camel xslt 2.0 support
Posted by weather99 <ff...@harris.com>.
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.TransformerFactoryImpl
javax.xml.transform.TransformerFactory=net.sf.saxon.TransformerFactoryImpl
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-tp5646214p5714932.html
Sent from the Camel - Users mailing list archive at Nabble.com.
RE: camel xslt 2.0 support
Posted by weather99 <ff...@harris.com>.
Hi Claus. Thanks so much for the reply. I was afraid that might cause some confusion.
I'm saying that an xslt 1.0 transfrom was done because all I got in the translated file was the prolog and nothing else, not because the xml version was 1.0.
The second example, where I just use a bean, actually shows the error where I get messages complaining about specific xslt 2.0 tags that it cannot handle.
Thanks.
Frank.
________________________________
From: Claus Ibsen-2 [via Camel] [ml-node+s465427n5714910h90@n5.nabble.com]
Sent: Friday, June 22, 2012 5:27 AM
To: Fleishaker, Frank
Subject: Re: camel xslt 2.0 support
On Fri, Jun 22, 2012 at 11:14 AM, Thibault <[hidden email]<https://mail.harris.com/owa/UrlBlockedError.aspx>> wrote:
> Are you sure the prolog <?xml version="1.0" encoding="UTF-8"?> indicates
> that a XSLT 1.0 transform was done ? I always thought this one was the
> prolog for the XML version, not for the transform applied...
> In my case, all my xslt 2.0 transform generates xml version 1.0.
>
Yes thats the XML standard. The world uses v1.0. I think there is a
1.1 version, but I dont see that in practice.
Its not related to XSLT.
http://en.wikipedia.org/wiki/XML
>
>
> 2012/6/21 weather99 [via Camel] <[hidden email]<https://mail.harris.com/owa/UrlBlockedError.aspx>>
>
>> Despite installing servicemix-saxon, and following the instructions on
>> this and other threads, I still cannot get xslt 2.0 to work in Servicemix
>> 4.4.1 or 4.4.2. The converted message shows up with only the prolog <?xml
>> version="1.0" encoding="UTF-8"?>, which indicates an xslt 1.0 conversion
>> was done.
>>
>> I'm using this as part of my route:
>> <camel:to
>> uri="xslt:file:xsl/my.xsl?transformerFactoryClass=net.sf.saxon.TransformerFactoryImpl"
>> />
>>
>> I have also tried this same thing via. a bean, with the same result:
>> <to uri="xslt:file:xsl/my.xsl?transformerFactory=tFactory" /> <bean
>> id="tFactory" class="net.sf.saxon.TransformerFactoryImpl" />
>>
>> In order to troubleshoot further, I embedded the entire xslt
>> transformation inside a bean, using the saxon9he jar file. It worked in
>> standalone Camel. To make sure I had no external dependencies for the
>> conversion, I built it with the extracted classes from the saxon jar. When
>> I tried to run it in Servicemix, i got this result:
>>
>> Line #1; Column #473; "xpath-default-namespace" attribute is not allowed
>> on the xsl:stylesheet element!
>> SystemId Unknown; Line #55; Column #86; Could not find function:
>> upper-case
>>
>> This also indicates that only an xslt 1.0 conversion was attempted, since
>> the processor doesn't know what to do with these tags. This is the bean I
>> was using: <bean ref="xslt20" method="map" />
>>
>> It appears that in Servicemix, the xalan jar in ./lib/endorsed overrides
>> all xslt processing no matter what. I tried removing the xalan-2.7.1.jar
>> from that directory. My route wouldn't start, and I got this message:
>>
>> org.springframework.beans.factory.BeanCreationException: Error creating
>> bean with name 'xslt20' defined in URL
>> [bundle://187.0:0/META-INF/spring/beans-0.0.0.xml]: Instantiation of bean
>> failed; nested exception is
>> javax.xml.transform.TransformerFactoryConfigurationError: Provider *
>> org.apache.xalan.processor*.TransformerFactoryImpl not found
>>
>> So it seems that it's always looking for xalan no matter what, which is
>> only an xslt 1.0 processor.
>>
>> Please advise as to what I'm doing wrong. We have a lot invested in xslt
>> 2.0 in standalone Camel, and I'm now at a dead-stop trying to deploy it to
>> Servicemix.
>>
>> Thanks.
>>
>>
>>
>>
>>
>> ------------------------------
>> 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-tp5646214p5714877.html
>> To start a new topic under Camel - Users, email
>> [hidden email]<https://mail.harris.com/owa/UrlBlockedError.aspx>
>> To unsubscribe from Camel - Users, click here<
>> .
>> NAML<<https://mail.harris.com/owa/UrlBlockedError.aspx>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-tp5646214p5714907.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
FuseSource
Email: [hidden email]<https://mail.harris.com/owa/UrlBlockedError.aspx>
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-tp5646214p5714910.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-tp5646214p5714920.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: camel xslt 2.0 support
Posted by Claus Ibsen <cl...@gmail.com>.
On Fri, Jun 22, 2012 at 11:14 AM, Thibault <th...@gmail.com> wrote:
> Are you sure the prolog <?xml version="1.0" encoding="UTF-8"?> indicates
> that a XSLT 1.0 transform was done ? I always thought this one was the
> prolog for the XML version, not for the transform applied...
> In my case, all my xslt 2.0 transform generates xml version 1.0.
>
Yes thats the XML standard. The world uses v1.0. I think there is a
1.1 version, but I dont see that in practice.
Its not related to XSLT.
http://en.wikipedia.org/wiki/XML
>
>
> 2012/6/21 weather99 [via Camel] <ml...@n5.nabble.com>
>
>> Despite installing servicemix-saxon, and following the instructions on
>> this and other threads, I still cannot get xslt 2.0 to work in Servicemix
>> 4.4.1 or 4.4.2. The converted message shows up with only the prolog <?xml
>> version="1.0" encoding="UTF-8"?>, which indicates an xslt 1.0 conversion
>> was done.
>>
>> I'm using this as part of my route:
>> <camel:to
>> uri="xslt:file:xsl/my.xsl?transformerFactoryClass=net.sf.saxon.TransformerFactoryImpl"
>> />
>>
>> I have also tried this same thing via. a bean, with the same result:
>> <to uri="xslt:file:xsl/my.xsl?transformerFactory=tFactory" /> <bean
>> id="tFactory" class="net.sf.saxon.TransformerFactoryImpl" />
>>
>> In order to troubleshoot further, I embedded the entire xslt
>> transformation inside a bean, using the saxon9he jar file. It worked in
>> standalone Camel. To make sure I had no external dependencies for the
>> conversion, I built it with the extracted classes from the saxon jar. When
>> I tried to run it in Servicemix, i got this result:
>>
>> Line #1; Column #473; "xpath-default-namespace" attribute is not allowed
>> on the xsl:stylesheet element!
>> SystemId Unknown; Line #55; Column #86; Could not find function:
>> upper-case
>>
>> This also indicates that only an xslt 1.0 conversion was attempted, since
>> the processor doesn't know what to do with these tags. This is the bean I
>> was using: <bean ref="xslt20" method="map" />
>>
>> It appears that in Servicemix, the xalan jar in ./lib/endorsed overrides
>> all xslt processing no matter what. I tried removing the xalan-2.7.1.jar
>> from that directory. My route wouldn't start, and I got this message:
>>
>> org.springframework.beans.factory.BeanCreationException: Error creating
>> bean with name 'xslt20' defined in URL
>> [bundle://187.0:0/META-INF/spring/beans-0.0.0.xml]: Instantiation of bean
>> failed; nested exception is
>> javax.xml.transform.TransformerFactoryConfigurationError: Provider *
>> org.apache.xalan.processor*.TransformerFactoryImpl not found
>>
>> So it seems that it's always looking for xalan no matter what, which is
>> only an xslt 1.0 processor.
>>
>> Please advise as to what I'm doing wrong. We have a lot invested in xslt
>> 2.0 in standalone Camel, and I'm now at a dead-stop trying to deploy it to
>> Servicemix.
>>
>> Thanks.
>>
>>
>>
>>
>>
>> ------------------------------
>> 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-tp5646214p5714877.html
>> To start a new topic under Camel - Users, email
>> ml-node+s465427n465428h3@n5.nabble.com
>> To unsubscribe from Camel - Users, click here<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=465428&code=dGhpYmF1bHQuY2Fzc2FuQGdtYWlsLmNvbXw0NjU0Mjh8MTIxODkxMDI2Nw==>
>> .
>> 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-tp5646214p5714907.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Re: camel xslt 2.0 support
Posted by Thibault <th...@gmail.com>.
Are you sure the prolog <?xml version="1.0" encoding="UTF-8"?> indicates
that a XSLT 1.0 transform was done ? I always thought this one was the
prolog for the XML version, not for the transform applied...
In my case, all my xslt 2.0 transform generates xml version 1.0.
2012/6/21 weather99 [via Camel] <ml...@n5.nabble.com>
> Despite installing servicemix-saxon, and following the instructions on
> this and other threads, I still cannot get xslt 2.0 to work in Servicemix
> 4.4.1 or 4.4.2. The converted message shows up with only the prolog <?xml
> version="1.0" encoding="UTF-8"?>, which indicates an xslt 1.0 conversion
> was done.
>
> I'm using this as part of my route:
> <camel:to
> uri="xslt:file:xsl/my.xsl?transformerFactoryClass=net.sf.saxon.TransformerFactoryImpl"
> />
>
> I have also tried this same thing via. a bean, with the same result:
> <to uri="xslt:file:xsl/my.xsl?transformerFactory=tFactory" /> <bean
> id="tFactory" class="net.sf.saxon.TransformerFactoryImpl" />
>
> In order to troubleshoot further, I embedded the entire xslt
> transformation inside a bean, using the saxon9he jar file. It worked in
> standalone Camel. To make sure I had no external dependencies for the
> conversion, I built it with the extracted classes from the saxon jar. When
> I tried to run it in Servicemix, i got this result:
>
> Line #1; Column #473; "xpath-default-namespace" attribute is not allowed
> on the xsl:stylesheet element!
> SystemId Unknown; Line #55; Column #86; Could not find function:
> upper-case
>
> This also indicates that only an xslt 1.0 conversion was attempted, since
> the processor doesn't know what to do with these tags. This is the bean I
> was using: <bean ref="xslt20" method="map" />
>
> It appears that in Servicemix, the xalan jar in ./lib/endorsed overrides
> all xslt processing no matter what. I tried removing the xalan-2.7.1.jar
> from that directory. My route wouldn't start, and I got this message:
>
> org.springframework.beans.factory.BeanCreationException: Error creating
> bean with name 'xslt20' defined in URL
> [bundle://187.0:0/META-INF/spring/beans-0.0.0.xml]: Instantiation of bean
> failed; nested exception is
> javax.xml.transform.TransformerFactoryConfigurationError: Provider *
> org.apache.xalan.processor*.TransformerFactoryImpl not found
>
> So it seems that it's always looking for xalan no matter what, which is
> only an xslt 1.0 processor.
>
> Please advise as to what I'm doing wrong. We have a lot invested in xslt
> 2.0 in standalone Camel, and I'm now at a dead-stop trying to deploy it to
> Servicemix.
>
> Thanks.
>
>
>
>
>
> ------------------------------
> 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-tp5646214p5714877.html
> To start a new topic under Camel - Users, email
> ml-node+s465427n465428h3@n5.nabble.com
> To unsubscribe from Camel - Users, click here<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=465428&code=dGhpYmF1bHQuY2Fzc2FuQGdtYWlsLmNvbXw0NjU0Mjh8MTIxODkxMDI2Nw==>
> .
> 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-tp5646214p5714907.html
Sent from the Camel - Users mailing list archive at Nabble.com.
RE: camel xslt 2.0 support
Posted by weather99 <ff...@harris.com>.
I included the xslt file as a resource in my jar and did what you suggested.
I got the same result: Only the prolog showed up in the converted message.
Thanks for the idea, though.
From: Henrique Viecili [via Camel] [mailto:ml-node+s465427n5715048h68@n5.nabble.com]
Sent: Monday, June 25, 2012 9:09 AM
To: Fleishaker, Frank
Subject: Re: camel xslt 2.0 support
I see you are using xsl:file:xsl/my.xsl, you don't need to use *file:*
which may be swallowing the transformerFactoryClass configuration. Try
using *only* xsl:xsl/my.xsl?transaformerFactoryClass
att.
*Henrique Viecili
*
On Thu, Jun 21, 2012 at 2:45 PM, weather99 <[hidden email]</user/SendEmail.jtp?type=node&node=5715048&i=0>> wrote:
> Despite installing servicemix-saxon, and following the instructions on this
> and other threads, I still cannot get xslt 2.0 to work in Servicemix 4.4.1
> or 4.4.2. The converted message shows up with only the prolog <?xml
> version="1.0" encoding="UTF-8"?>, which indicates an xslt 1.0 conversion
> was
> done.
>
> I'm using this as part of my route:
> <camel:to
>
> uri="xslt:file:xsl/my.xsl?transformerFactoryClass=net.sf.saxon.TransformerFactoryImpl"
> />
>
> I have also tried this same thing via. a bean, with the same result:
> <to uri="xslt:file:xsl/my.xsl?transformerFactory=tFactory" /> <bean
> id="tFactory" class="net.sf.saxon.TransformerFactoryImpl" />
>
> In order to troubleshoot further, I embedded the entire xslt transformation
> inside a bean, using the saxon9he jar file. It worked in standalone Camel.
> To make sure I had no external dependencies for the conversion, I built it
> with the extracted classes from the saxon jar. When I tried to run it in
> Servicemix, i got this result:
>
> Line #1; Column #473; "xpath-default-namespace" attribute is not allowed on
> the xsl:stylesheet element!
> SystemId Unknown; Line #55; Column #86; Could not find function: upper-case
>
> This also indicates that only an xslt 1.0 conversion was attempted, since
> the processor doesn't know what to do with these tags. This is the bean I
> was using: <bean ref="xslt20" method="map" />
>
> It appears that in Servicemix, the xalan jar in ./lib/endorsed overrides
> all
> xslt processing no matter what. I tried removing the xalan-2.7.1.jar from
> that directory. My route wouldn't start, and I got this message:
>
> org.springframework.beans.factory.BeanCreationException: Error creating
> bean
> with name 'xslt20' defined in URL
> [bundle://187.0:0/META-INF/spring/beans-0.0.0.xml]: Instantiation of bean
> failed; nested exception is
> javax.xml.transform.TransformerFactoryConfigurationError: Provider
> *org.apache.xalan.processor*.TransformerFactoryImpl not found
>
> So it seems that it's always looking for xalan no matter what, which is
> only
> an xslt 1.0 processor.
>
> Please advise as to what I'm doing wrong. We have a lot invested in xslt
> 2.0 in standalone Camel, and I'm now at a dead-stop trying to deploy it to
> Servicemix.
>
> Thanks.
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/camel-xslt-2-0-support-tp5646214p5714877.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
________________________________
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-tp5646214p5715048.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-tp5646214p5715116.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: camel xslt 2.0 support
Posted by Henrique Viecili <he...@myreks.com>.
I see you are using xsl:file:xsl/my.xsl, you don't need to use *file:*
which may be swallowing the transformerFactoryClass configuration. Try
using *only* xsl:xsl/my.xsl?transaformerFactoryClass
att.
*Henrique Viecili
*
On Thu, Jun 21, 2012 at 2:45 PM, weather99 <ff...@harris.com> wrote:
> Despite installing servicemix-saxon, and following the instructions on this
> and other threads, I still cannot get xslt 2.0 to work in Servicemix 4.4.1
> or 4.4.2. The converted message shows up with only the prolog <?xml
> version="1.0" encoding="UTF-8"?>, which indicates an xslt 1.0 conversion
> was
> done.
>
> I'm using this as part of my route:
> <camel:to
>
> uri="xslt:file:xsl/my.xsl?transformerFactoryClass=net.sf.saxon.TransformerFactoryImpl"
> />
>
> I have also tried this same thing via. a bean, with the same result:
> <to uri="xslt:file:xsl/my.xsl?transformerFactory=tFactory" /> <bean
> id="tFactory" class="net.sf.saxon.TransformerFactoryImpl" />
>
> In order to troubleshoot further, I embedded the entire xslt transformation
> inside a bean, using the saxon9he jar file. It worked in standalone Camel.
> To make sure I had no external dependencies for the conversion, I built it
> with the extracted classes from the saxon jar. When I tried to run it in
> Servicemix, i got this result:
>
> Line #1; Column #473; "xpath-default-namespace" attribute is not allowed on
> the xsl:stylesheet element!
> SystemId Unknown; Line #55; Column #86; Could not find function: upper-case
>
> This also indicates that only an xslt 1.0 conversion was attempted, since
> the processor doesn't know what to do with these tags. This is the bean I
> was using: <bean ref="xslt20" method="map" />
>
> It appears that in Servicemix, the xalan jar in ./lib/endorsed overrides
> all
> xslt processing no matter what. I tried removing the xalan-2.7.1.jar from
> that directory. My route wouldn't start, and I got this message:
>
> org.springframework.beans.factory.BeanCreationException: Error creating
> bean
> with name 'xslt20' defined in URL
> [bundle://187.0:0/META-INF/spring/beans-0.0.0.xml]: Instantiation of bean
> failed; nested exception is
> javax.xml.transform.TransformerFactoryConfigurationError: Provider
> *org.apache.xalan.processor*.TransformerFactoryImpl not found
>
> So it seems that it's always looking for xalan no matter what, which is
> only
> an xslt 1.0 processor.
>
> Please advise as to what I'm doing wrong. We have a lot invested in xslt
> 2.0 in standalone Camel, and I'm now at a dead-stop trying to deploy it to
> Servicemix.
>
> Thanks.
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/camel-xslt-2-0-support-tp5646214p5714877.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
Re: camel xslt 2.0 support
Posted by weather99 <ff...@harris.com>.
Despite installing servicemix-saxon, and following the instructions on this
and other threads, I still cannot get xslt 2.0 to work in Servicemix 4.4.1
or 4.4.2. The converted message shows up with only the prolog <?xml
version="1.0" encoding="UTF-8"?>, which indicates an xslt 1.0 conversion was
done.
I'm using this as part of my route:
<camel:to
uri="xslt:file:xsl/my.xsl?transformerFactoryClass=net.sf.saxon.TransformerFactoryImpl"
/>
I have also tried this same thing via. a bean, with the same result:
<to uri="xslt:file:xsl/my.xsl?transformerFactory=tFactory" /> <bean
id="tFactory" class="net.sf.saxon.TransformerFactoryImpl" />
In order to troubleshoot further, I embedded the entire xslt transformation
inside a bean, using the saxon9he jar file. It worked in standalone Camel.
To make sure I had no external dependencies for the conversion, I built it
with the extracted classes from the saxon jar. When I tried to run it in
Servicemix, i got this result:
Line #1; Column #473; "xpath-default-namespace" attribute is not allowed on
the xsl:stylesheet element!
SystemId Unknown; Line #55; Column #86; Could not find function: upper-case
This also indicates that only an xslt 1.0 conversion was attempted, since
the processor doesn't know what to do with these tags. This is the bean I
was using: <bean ref="xslt20" method="map" />
It appears that in Servicemix, the xalan jar in ./lib/endorsed overrides all
xslt processing no matter what. I tried removing the xalan-2.7.1.jar from
that directory. My route wouldn't start, and I got this message:
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'xslt20' defined in URL
[bundle://187.0:0/META-INF/spring/beans-0.0.0.xml]: Instantiation of bean
failed; nested exception is
javax.xml.transform.TransformerFactoryConfigurationError: Provider
*org.apache.xalan.processor*.TransformerFactoryImpl not found
So it seems that it's always looking for xalan no matter what, which is only
an xslt 1.0 processor.
Please advise as to what I'm doing wrong. We have a lot invested in xslt
2.0 in standalone Camel, and I'm now at a dead-stop trying to deploy it to
Servicemix.
Thanks.
--
View this message in context: http://camel.465427.n5.nabble.com/camel-xslt-2-0-support-tp5646214p5714877.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: camel xslt 2.0 support
Posted by Claus Ibsen <cl...@gmail.com>.
Hi
You need to install camel-saxon feature as it has saxon xml library
which offers xslt 2.0 I think.
http://saxon.sourceforge.net/
You most likely also need to restart the ESB.
The old xalan that is shipped with the JVM is only support XSLT 1.x I think.
http://xml.apache.org/xalan-j/
On Tue, Apr 17, 2012 at 12:24 PM, pchakinala
<pr...@planetsoft.com> wrote:
> Hi,
> we are using camel-xslt component for xml transformation and xslt version is
> 2.0. Below route definition is working fine with servicemix 4.3.
>
> <route>
> <from uri="jetty:http://0.0.0.0:8192/httpRepreq/"/>
> <to uri="xslt:car-response1.xsl"/>
> <to
> uri="http://localhost:8080/jsp-examples/checkbox/mefACK.jsp?bridgeEndpoint=true"/>
> </route>
> However we require xslt 2.0 support for that i have changed uri like below
> in the route definition.
> After modifing the definition found below error at the time of bundle
> deployment
> <to uri="xslt:car-response1.xsl?transformerFactory=tFactory"/>
>
> Error:
> admin@root>Exception in thread "SpringOsgiExtenderThread-18"
> org.apache.camel.RuntimeCamelException:
> org.apache.camel.FailedToCreateRouteException: Fa
> iled to create route route5 at: >>>
> To[xslt:car-response1.xsl?transformerFactory=tFactory] <<< in route:
> Route[[From[jetty:http://0.0.0.0:8192/httpRep
> req/]] -> [conv... because of Failed to resolve endpoint:
> xslt://car-response1.xsl?transformerFactory=tFactory due to: Could not
> compile stylesheet cl
> ass path resource [car-response1.xsl]
> at
> org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1164)
> at
> org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:117)
> at
> org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:240)
> at
> org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:97)
> at
> org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:303)
> at
> org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:911)
> at
> org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext.finishRefresh(AbstractOsgiBundleApplicationContext.java:235)
> at
> org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.ja
> va:358)
> at
> org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
> at
> org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplication
> Context.java:320)
> at
> org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(Dependen
> cyWaiterApplicationContextExecutor.java:132)
> at java.lang.Thread.run(Thread.java:662)
> Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create
> route route5 at: >>> To[xslt:car-response1.xsl?transformerFactory=tFactory]
> <<< in route: Route[[From[jetty:http://0.0.0.0:8192/httpRepreq/]] ->
> [conv... because of Failed to resolve endpoint:
> xslt://car-response1.xsl?transfo
> rmerFactory=tFactory due to: Could not compile stylesheet class path
> resource [car-response1.xsl]
> at
> org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:820)
> at
> org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:165)
> at
> org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:697)
> at
> org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1665)
> at
> org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1452)
> at
> org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1349)
> at
> org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.java:176)
> at
> org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:67)
> at
> org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:54)
> at
> org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1317)
> at
> org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:221)
> at
> org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:115)
> ... 10 more
> Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to
> resolve endpoint: xslt://car-response1.xsl?transformerFactory=tFactory due
> to: C
> ould not compile stylesheet class path resource [car-response1.xsl]
> at
> org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:443)
> at
> org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:48)
> at
> org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:180)
> at
> org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:110)
> at
> org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:116)
> at
> org.apache.camel.model.SendDefinition.resolveEndpoint(SendDefinition.java:61)
> at
> org.apache.camel.model.SendDefinition.createProcessor(SendDefinition.java:55)
> at
> org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:437)
> at
> org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:183)
> at
> org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:817)
> ... 21 more
> Caused by: javax.xml.transform.TransformerConfigurationException: Could not
> compile stylesheet class path resource [car-response1.xsl]
> at
> org.apache.camel.component.xslt.XsltComponent.loadResource(XsltComponent.java:175)
> at
> org.apache.camel.component.xslt.XsltComponent.createEndpoint(XsltComponent.java:133)
> at
> org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:75)
> at
> org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:425)
> ... 30 more
> Caused by: javax.xml.transform.TransformerConfigurationException: Could not
> compile stylesheet
> at
> org.apache.xalan.xsltc.trax.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:832)
> at
> org.apache.camel.builder.xml.XsltBuilder.setTransformerSource(XsltBuilder.java:301)
> at
> org.apache.camel.builder.xml.XsltBuilder.setTransformerInputStream(XsltBuilder.java:331)
> at
> org.apache.camel.component.xslt.XsltComponent.loadResource(XsltComponent.java:170)
> ... 33 more
>
>
> Can you suggest how to configure transformerFactory property? Is this
> approach works with XSLT 2.0 Style sheets
>
> thanks
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/camel-xslt-2-0-support-tp5646214p5646214.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/