How to parse message to XQuery’s function paramter
By Apache Camel, you could easily pass Xml file to XQuery,
if you XQuery does not have function which takes input message as paramter, you could simply build route like below and it will work.
|
|
But if you xquery has its’s function which taking input xml message as parameter, then this route will not work, since you need pass xml as message to xquery
|
|
But you could use $in.body(camel buildi in variable) which mapped to body(message, xml string) to pass it to XQuery’s function with a little bit modification as below, and of couse make sure the XQuery version is >=3.0, since parse-xml is function since XQuery3.0
|
|
Of couse, you also need to convert message from file to Xml String in this case as below shown.
|
|