camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen J <stephen.joy...@mclaneco.com>
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:

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

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.
Thanks.
-- 
View this message in context: http://www.nabble.com/XPath-filter-with-spring-xml-configuration-question-tp18634280s22882p18634280.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message