Thanks for the response. The XPathBuilder expects the content somewhere. I was not sure where I can provide that in a Router.
Instead, I settled for this: .setHeader("abc", ns.xpath("//@event", String.class)) Thanks! On Fri, Feb 25, 2011 at 11:40 PM, Pham Ngoc Hai <pngoc...@yahoo.com> wrote: > Can you try: > .setHeader("abc", XPathBuilder.xpath("/c:msg@event", > String.class).namespace(ns)) > > Regards, > Ngoc Hai > > --- On Fri, 2/25/11, bigbear <strutsus...@gmail.com> wrote: > > > From: bigbear <strutsus...@gmail.com> > > Subject: xpath and header > > To: users@camel.apache.org > > Date: Friday, February 25, 2011, 11:27 PM > > Hi, > > > > I am trying to set the result of an xpath expression > > evaluation in the > > header and it is failing: > > > > > > from("jms:topic:someTopic") > > > > .setHeader("abc", xpath("/c:msg@event", > > String.class, ns)) > > > > > > Getting this error: > > > > The method xpath(String) in the type BuilderSupport is not > > applicable for > > the arguments (String, Class<String>, Namespaces). > > > > It looks like the 'xpath' in the router is different than > > the 'xpath' in > > setHeader. > > > > Any ideas. > > > > Thanks! > > > > > >