You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Wang Yan <wy...@gmail.com> on 2018/10/24 08:41:30 UTC

camel XPATH variable to XQuery element() convert problem

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']")

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() ?