camel XPATH variable to XQuery element() convert problem

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

camel XPATH variable to XQuery element() convert problem

nono
This post was updated on .
In Apache camel I need to extract a xml element and pass it to xquery as
element(), but i have strange error. Any idea and suggesions are more than
welcome!

Camel code:

from(SOAP_ENDPOINT_IN_URI + "&dataFormat=CXF_MESSAGE")
.setHeader("CMDRequest",  XPathBuilder.xpath("(//*[local-name()='CMDRequest'])[1]")

Xquery code:

declare variable $in.headers.CMDRequest as element() external ;

Error:

Caused by: net.sf.saxon.trans.XPathException: Required item type of value
of variable $in.headers.GetDeltaCustomerRequest is element(); supplied
value has item type Q{http://saxon.sf.net/java-type
}com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList

xquery <https://stackoverflow.com/questions/tagged/xquery>

Or equivalent java type for xquery element() ?

or is it possible to check object type of in.headers.CMDRequest ?