You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Christian Schäfer <sy...@yahoo.de> on 2013/03/10 19:01:22 UTC
No body after XSLT transformation
Hi,
just tried a simple xslt example with camel 2.10.4 by modifying the file copier example of the camel in action book.
I don't understand why there is no body output after the xslt step and why it doesn't step into the processor when there is a breakpoint inside it.
What am I doing wrong here?
How can I achieve a further processing of the xslt output in the same route?
public class XSLTTest {
public static void main(String args[]) throws Exception {
// create CamelContext
CamelContext context = new DefaultCamelContext();
// add our route to the CamelContext
context.addRoutes(new RouteBuilder() {
public void configure() {
from("file:data/xslt/test.xml?noop=true")
.to("xslt:file:C:\\dev\\java\\camelinaction-source\\chapter1\\file-copy\\data\\xslt\\test.xsl")
.log("converted: ${body}")
.process(new Processor() {
@Override
public void process(Exchange exchange) throws Exception {
String s="";
}
});
}
});
// start the route and let it do its work
context.start();
Thread.sleep(10000);
// stop the CamelContext
context.stop();
}
}
Re: No body after XSLT transformation
Posted by Willem jiang <wi...@gmail.com>.
Hi,
Did you have refresh the project and have clean build with the codes that you changed?
--
Willem Jiang
Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang
Weibo: 姜宁willem
On Monday, March 11, 2013 at 2:01 AM, Christian Schäfer wrote:
> Hi,
>
> just tried a simple xslt example with camel 2.10.4 by modifying the file copier example of the camel in action book.
>
> I don't understand why there is no body output after the xslt step and why it doesn't step into the processor when there is a breakpoint inside it.
>
> What am I doing wrong here?
> How can I achieve a further processing of the xslt output in the same route?
>
> public class XSLTTest {
>
> public static void main(String args[]) throws Exception {
> // create CamelContext
> CamelContext context = new DefaultCamelContext();
>
> // add our route to the CamelContext
> context.addRoutes(new RouteBuilder() {
> public void configure() {
> from("file:data/xslt/test.xml?noop=true")
> .to("xslt:file:C:\\dev\\java\\camelinaction-source\\chapter1\\file-copy\\data\\xslt\\test.xsl")
> .log("converted: ${body}")
> .process(new Processor() {
> @Override
> public void process(Exchange exchange) throws Exception {
> String s="";
> }
> });
> }
> });
>
> // start the route and let it do its work
> context.start();
> Thread.sleep(10000);
>
> // stop the CamelContext
> context.stop();
> }
> }