You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by felixnutella <sv...@vehco.com> on 2013/01/02 17:36:18 UTC
Relative URL for XSL in XSLT component
Hi all
I'm quite new at Camel but have managed to get it up and running using a few
custom components/converters...
But..
Is it true that you need to specify an absolute path for the XSL in the XSLT
component? Whenever I try to specify an relative, it comes up with File not
found.
I'm specifying the xslt transformation as: <camel:to
uri="xslt:file://xsl/customer.xsl?transformerFactoryClass=net.sf.saxon.TransformerFactoryImpl&contentCache=false"/>
- this does not work...
If I'm doing it like: <camel:to
uri="xslt:file://C:/Users/USERNAME/Desktop/apache-servicemix-4.4.2/xsl/customer.xsl?transformerFactoryClass=net.sf.saxon.TransformerFactoryImpl&contentCache=false"/>
it works perfectly.
It should be said that Camel is running inside servicemix, which should be
version 2.8.5 if that has any meaning.
--
View this message in context: http://camel.465427.n5.nabble.com/Relative-URL-for-XSL-in-XSLT-component-tp5724794.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Relative URL for XSL in XSLT component
Posted by felixnutella <sv...@vehco.com>.
Almost correct here... If I remove the double slashes after file: it works.
If I just remove file: it defaults to classpath which is not what I want...
But thank you for pointing me to the tests - it clarified it :)
Regards,
Svend
--
View this message in context: http://camel.465427.n5.nabble.com/Relative-URL-for-XSL-in-XSLT-component-tp5724794p5724867.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Relative URL for XSL in XSLT component
Posted by Ujeen <uj...@ujeen.com>.
Hi, guys
bringing this thread back to live
I faced a case when relative path like this: ../../test/xslt doesn't work
Here is what I do
<setHeader headerName="xslt-local-url">
<simple>../../test/xslt/EQM98_30032015</simple>
</setHeader>
<recipientList>
<simple>xslt:file:${header.xslt-local-url}</simple>
</recipientList>
I get error like this:
11:05:34,747 MSK ERROR DefaultErrorHandler - Failed delivery for (MessageId:
ID-RUMOSWS100028-50314-1433923531567-0-5 on ExchangeId:
ID-RUMOSWS100028-50314-1433923531567-0-6). Exhausted after delivery attempt:
1 caught: org.apache.camel.ResolveEndpointFailedException: Failed to resolve
endpoint: xslt://file:../../test/xslt/EQM98_30032015.xslt due to:
java.io.FileNotFoundException: Cannot find resource:
test/xslt/EQM98_30032015.xslt in classpath for URI:
test\xslt\EQM98_30032015.xslt
Message History ...
org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint:
xslt://file:../../test/xslt/EQM98_30032015.xslt due to:
java.io.FileNotFoundException: Cannot find resource:
test/xslt/EQM98_30032015.xslt in classpath for URI:
test\xslt\EQM98_30032015.xslt
at
org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:534)
at
org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:71)
at
org.apache.camel.util.ExchangeHelper.resolveEndpoint(ExchangeHelper.java:88)
at
org.apache.camel.processor.RecipientListProcessor.resolveEndpoint(RecipientListProcessor.java:223)
at
org.apache.camel.processor.RecipientListProcessor.createProcessorExchangePairs(RecipientListProcessor.java:163)
at
org.apache.camel.processor.MulticastProcessor.process(MulticastProcessor.java:208)
at
org.apache.camel.processor.RecipientList.sendToRecipientList(RecipientList.java:167)
at org.apache.camel.processor.RecipientList.process(RecipientList.java:120)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:118)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)
at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)
Would be happy to get any advises
Thank you.
--
View this message in context: http://camel.465427.n5.nabble.com/Relative-URL-for-XSL-in-XSLT-component-tp5724794p5768059.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Relative URL for XSL in XSLT component
Posted by Christian Müller <ch...@gmail.com>.
Please have a look at [1] which shows it works.
Could you please remove "file:" and try it again.
[1]
https://svn.apache.org/repos/asf/camel/tags/camel-2.8.5/components/camel-spring/src/test/java/org/apache/camel/component/xslt/XsltFromFileExceptionTest.java
Best,
Christian
On Wed, Jan 2, 2013 at 5:36 PM, felixnutella <sv...@vehco.com>wrote:
> Hi all
>
> I'm quite new at Camel but have managed to get it up and running using a
> few
> custom components/converters...
>
> But..
>
> Is it true that you need to specify an absolute path for the XSL in the
> XSLT
> component? Whenever I try to specify an relative, it comes up with File not
> found.
>
> I'm specifying the xslt transformation as: <camel:to
>
> uri="xslt:file://xsl/customer.xsl?transformerFactoryClass=net.sf.saxon.TransformerFactoryImpl&contentCache=false"/>
> - this does not work...
>
> If I'm doing it like: <camel:to
>
> uri="xslt:file://C:/Users/USERNAME/Desktop/apache-servicemix-4.4.2/xsl/customer.xsl?transformerFactoryClass=net.sf.saxon.TransformerFactoryImpl&contentCache=false"/>
> it works perfectly.
>
> It should be said that Camel is running inside servicemix, which should be
> version 2.8.5 if that has any meaning.
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Relative-URL-for-XSL-in-XSLT-component-tp5724794.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
--