camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: help with getting xpath value?
Date Mon, 24 Mar 2014 16:19:33 GMT
Tell Camel you want it as a String type, by passing in String.class as
a parameter to the xpath function

On Mon, Mar 24, 2014 at 5:07 PM, sb.append <a261427@drdrb.net> wrote:
> Hello,
>
> I cannot get the value of node into header. what I'm doing wrong here?
>
> <entry xmlns="http://www.w3.org/2005/Atom">
>         <id>123</id>
> </entry>
>
>
> .split(body().tokenizeXML("entry", "entries"))
> .log("${body}")
> .setHeader("entry", xpath("/c:entry/id/node()").namespace("c",
> "http://www.w3.org/2005/Atom"))
>
> but header is then entry =>
> com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList not the value of id
> node.
>
> I'd expect camel would convert node into string => 123
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/help-with-getting-xpath-value-tp5749286.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Make your Camel applications look hawt, try: http://hawt.io

Mime
View raw message