Try .setHeader("FOO", xpath("/foo/bar/@value", String.class))
xpath assumes that it will return a node list. You have to tell it if that is not the case. I have a similar issue with an xpath with a count expression and it throws an exception because it cannot convert from number to node list. On Oct 8, 2013, at 4:23 PM, Chris <cwolf.a...@gmail.com> wrote: > > If my in msg body is: > > <foo> > <bar value="hello"/> > </foo> > > ...then, when doing: > > .setHeader("FOO", xpath("/foo/bar/@value")) > > I expect the header named "FOO" to have String value of "hello", instead, I > see: net.sf.saxon.dom.DOMNodeList@74184b3b > > Is there any way to make this work? > > Thanks, > > Chris >