camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen J <>
Subject XPath filter with spring xml configuration question
Date Thu, 24 Jul 2008 15:25:11 GMT

I have a camel route defined as follows:

	   	<from uri="amq:fruitTree"/>
	   	<process ref="fruitHeaderInjector" />
	   	<xpath>$fruitType = 'apple'</xpath>
        	<to uri="velocity:templates/AppleTemplate.vm" />
        	<process ref="velocityProcessor" />
	   	<xpath>$fruitType = 'orange'</xpath>
        	<to uri="velocity:templates/OrangeTemplate.vm" />
    	    <process ref="velocityProcessor" />

where the route pulls a message from an ActiveMQ queue, then adds a header
with the fruitHeaderInjector, then based on the xpath filter should process
the message with one of the velocity templates defined.

The only code in the process method of the header injector class is:
exch.getIn().setHeader("fruitType", exch.getIn().getBody(String.class));

When camel tries to process the xpath expression I get the following error:
"Content is not allowed in prolog."

Can someone tell me if I'm doing something wrong with the header processor,
or if I've run into a bug?
I have a junit test of the described application if that will help.
View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message