On Thu, 2009-10-15 at 08:37 +0200, Claus Ibsen wrote: > On Wed, Oct 14, 2009 at 11:07 PM, Dragisa Krsmanovic > <dkrsmano...@plos.org> wrote: > > On Wed, 2009-10-14 at 05:58 +0200, Claus Ibsen wrote: > >> Ah the reason is that the javac and generics is limited in terms of DSL > >> wise. > >> > >> What you need to do is to pass in the xpath as a 2nd parameter to > >> setHeader. > >> > >> This > >> .setHeader(DOI).xpath("/ambraMessage/doi/text()", String.class) > >> > >> Should be > >> .setHeader(DOI, xpath("/ambraMessage/doi/text()", String.class)) > >> > > > > I don't seem to have luck with this. This doesn't compile: > > > > from("activemq:plos.pmc") > > .setHeader(DOI, xpath("/ambraMessage/doi/text()", String.class)) > > .to("mock:end"); > > > > xpath() is not defined in RouteBuilder. > > Dont your IDE have good help? IDEA pop up with a list of suggestions :) > > You need to static import from XPathBuilder: > > import static org.apache.camel.builder.xml.XPathBuilder.xpath;
Yes, Idea pops up suggestion now that I've included it. ;) Ahem... It's a little bit hard to navigate documentation. Where would one find details about this ? -- Dragisa Krsmanovic Java Developer Public Library of Science http://www.plos.org