On Wed, Sep 26, 2012 at 8:42 AM, balkishore <balkishore.pan...@gmail.com> wrote: > Hi claus, > If i use the Xpath java API, something like this: > > XPathExpression expression = > xpath.compile("substring(string(/*[local-name()='Envelope']/*[local-name()='Header']/*[local-name()='ReplyTo']/*[local-name()='ReferenceParameters']/*[local-name()='ServiceGroupId']/text()), > 10)"); > > String id = expression.evaluate(exchange.getContext(), body); > > I get an error saying The method evaluate(Object, QName) in the type > XPathExpression is not applicable for the arguments (CamelContext, String) >
Google and read some tutorials how to use the xpath api from the JDK. You should not pass in CamelContext to the evaluate method. > And if use the Xpathbuilder, it gives me an error saying invalid xpath > expression. But when i test the same xpath expression using Xapth java API, > i get the serviceGroup id. > If <ServiceGroup> is unique in the XML, then you can just do a simple String search and grab the text between the start and end tags Though its a bit of a hack. > Any help would be really useful. > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Using-a-custom-based-load-balancer-tp5719841p5719999.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- Red Hat, Inc. FuseSource is now part of Red Hat Email: cib...@redhat.com Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen