On Tue, Jun 12, 2012 at 12:17 AM, paramjyotsingh
<paramjyotsi...@gmail.com>wrote:

> Hi,
>
> I am trying to use XPath, but somehow it is not responding the way it is
> supposed to.
>
> Example i have a xml input of type:-
>
> <Products>
>   <Product type="BOX">
>   ..
>   </Product>
> </Products>
>
> and I am trying spring dsl filter:-
>
> <route>
>  <from uri="file:///test/folder" />
>  <filter>
>     <xpath>/Products/Product[@type='BOX']</xpath>
>     <to uri="file://test/matchedFile" />
>  </filter>
> </route>
>
> with XML input i provided the filter should match Xpath predicate and
> should
> move file to /test/mactchedFile folder. But this is not happening
>
> Please help me to resolve this issue.
>
>
What version of Camel are you using?

And are you using any namespaces in your XML? If so the xpath expression
must have namespace mapping as well.

Also you can try to force loading the file content into memory before the
xpath filter, using convert body to:
 <from uri="file:///test/folder" />
 <convertBodyTo type="String"/>
 <filter>



Regards,
> Paramjyot
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/XPath-Filter-not-working-tp5714310.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Reply via email to