Re: setHeader("FOO", xpath("/foo/bar/@value")) is of type net.sf.saxon.dom.DOMNodeList - not String, ideas?

2013-10-08 Thread Willem jiang
Hi, I just Filled a JIRA[1] for it and the patch is on the way. [1]https://issues.apache.org/jira/browse/CAMEL-6841 -- Willem Jiang Red Hat, Inc. Web: http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (ht

Re: setHeader("FOO", xpath("/foo/bar/@value")) is of type net.sf.saxon.dom.DOMNodeList - not String, ideas?

2013-10-08 Thread Dale King
Yeah, was doing it off the top of my head. I knew there was a 2-arg version of xpath, but I guess that is only in the fluent API. It should support it in the xpath support method as well. On Tue, Oct 8, 2013 at 4:35 PM, Chris wrote: > Dale, > > Thanks for the help - I thought there was an optio

Re: setHeader("FOO", xpath("/foo/bar/@value")) is of type net.sf.saxon.dom.DOMNodeList - not String, ideas?

2013-10-08 Thread Chris
Dale, Thanks for the help - I thought there was an optional 2nd arg for type, but my Eclipse code completion didn't list it. I put it in anyway and got: The method xpath(String) in the type BuilderSupport is not applicable for the arguments (String, Class) ...then I tried the single arg vers

Re: setHeader("FOO", xpath("/foo/bar/@value")) is of type net.sf.saxon.dom.DOMNodeList - not String, ideas?

2013-10-08 Thread Chris
..and when I try: .setHeader("FOO", xpath("string(/foo/bar/@value)")) I get: org.apache.camel.builder.xml.InvalidXPathExpression: Invalid xpath: string(/foo/bar/@value). Reason: javax.xml.xpath.XPathExpressionException On 10/8/2013 4:23 PM, Chris wrote: If my in msg body is: ...the

Re: setHeader("FOO", xpath("/foo/bar/@value")) is of type net.sf.saxon.dom.DOMNodeList - not String, ideas?

2013-10-08 Thread Dale King
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.

setHeader("FOO", xpath("/foo/bar/@value")) is of type net.sf.saxon.dom.DOMNodeList - not String, ideas?

2013-10-08 Thread Chris
If my in msg body is: ...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