camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen" ...@silverbullet.dk>
Subject RE: how to use xpath in spring xml and query header fields
Date Wed, 23 Jul 2008 06:09:57 GMT
Hi

I have added a spring xpath header sample to the xpath wiki page. Will take a little while
to get updated:
http://activemq.apache.org/camel/xpath.html

Or if you are impatient check the dynamic cwiki page:
http://cwiki.apache.org/confluence/display/CAMEL/XPath 


The unit test is also in the code. You can browse it online:
http://activemq.apache.org/camel/source.html

Look in the components/camel-spring for the SpringXPathHederTest.java in test/java and the
SpringXPathHederTest-context.xml in the test/resources folder.


Basically using <xpath>$queueid = '0'</xpath> should do the trick



Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk

-----Original Message-----
From: buchnerm [mailto:markus.buchner@gmx.at] 
Sent: 21. juli 2008 16:54
To: camel-user@activemq.apache.org
Subject: Re: how to use xpath in spring xml and query header fields


Sorry but I cant get it working with xpath - I could get it working now with
jxpath - I found a test case:

http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jxpath/src/test/java/org/apache/camel/language/jxpath/JXPathTest.java?view=markup

this route works for me now: 

		<route>
			<from ref="input1" />
			<to uri="counter" />
			<to uri="createProcessor" />
			<to uri="realtimeProcessor" />
			<to uri="queueSwitchProcessor" />
			<choice>
		      <when>
		        <jxpath>in/headers/@queueid = '0'</jxpath>
		        <to ref="output1"/>
		      </when>
		      <when>
		        <jxpath>in/headers/@queueid = '1'</jxpath>
		        <to ref="output2"/>
		      </when>
		      <otherwise>
		        <to ref="output3"/>
		      </otherwise>
		    </choice>
		</route>

although I think jxpath is much slower than xpath or??? so I am looking
forward to solve it another way 

Thanks for the fast reply - greetings max
-- 
View this message in context: http://www.nabble.com/how-to-use-xpath-in-spring-xml-and-query-header-fields-tp18567110s22882p18570337.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message