You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by l_tsall <le...@yahoo.com> on 2011/05/13 16:36:20 UTC

Re: xpath 2.0 function bean binding camel xpath annotation

Hi again, 

Thanks for resolving this issue.

But which is the proper resultType for the very useful xpath function
distinct-values which returns a sequence of atomic values?

template.sendBody("<order
customerId=\"123\"><credit><value>10</value><value>10</value><value>12</value></credit></order>");

I can bind this with 
@XQuery("distinct-values(/order/credit/value)") String values  
and get distinctValues: 1012 

but  @XPath(distinct-values(/order/credit/value") NodeList nodes
generates as expected  
Extension function required class org.w3c.dom.NodeList; supplied value of
class net.sf.saxon.value.UntypedAtomicValue could not be converted

Would it be possible bind the result in a List<String> 
something like 
@XPath(value="distinct-values(/order/credit/value)",resultType=List.class )
List<String> distinctValues  ?

--
View this message in context: http://camel.465427.n5.nabble.com/xpath-2-0-function-bean-binding-camel-xpath-annotation-tp4344611p4393304.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: xpath 2.0 function bean binding camel xpath annotation

Posted by boday <be...@initekconsulting.com>.
l_tsall, haven't had a chance to look at this yet, but I'll see what I can do
(in the next week hopefully)...


l_tsall wrote:
> 
> Hi again, 
> 
> Thanks for resolving this issue.
> 
> But which is the proper resultType for the very useful xpath function
> distinct-values which returns a sequence of atomic values?
> 
> template.sendBody("<order
> customerId=\"123\"><credit><value>10</value><value>10</value><value>12</value></credit></order>");
> 
> I can bind this with 
> @XQuery("distinct-values(/order/credit/value)") String distinctValues  
> and get distinctValues: 1012 
> 
> but  @XPath(distinct-values(/order/credit/value") NodeList nodes
> generates as expected  
> Extension function required class org.w3c.dom.NodeList; supplied value of
> class net.sf.saxon.value.UntypedAtomicValue could not be converted
> 
> Would it be possible bind the result in a List<String> 
> something like 
> @XPath(value="distinct-values(/order/credit/value)",resultType=List.class
> ) List<String> distinctValues  ?
> 


-----
Ben O'Day
IT Consultant -http://benoday.blogspot.com

--
View this message in context: http://camel.465427.n5.nabble.com/xpath-2-0-function-bean-binding-camel-xpath-annotation-tp4344611p4407263.html
Sent from the Camel - Users mailing list archive at Nabble.com.