|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Error while mixing Xpath and ESQL in mapping node - IIB V9 |
« View previous topic :: View next topic » |
Author |
Message
|
alaychem |
Posted: Tue Feb 13, 2018 4:04 am Post subject: Error while mixing Xpath and ESQL in mapping node - IIB V9 |
|
|
Acolyte
Joined: 10 Feb 2016 Posts: 66
|
I'm getting the following error while mixing Xpath and custom ESQL:
Code: |
[ERR 0395][ERR XPTY0004] The argument was expected to be a sequence containing no items or one item, but the value is a sequence containing more than one item. It is a type error if a value does not match a required type as specified by the SequenceType matching rules. |
The expression in the mapping node is:
Code: |
<customFunction lang="esql" ref="BidiUtils:esbBidiHebrewConvert">
<input path="request_by_array/request_by/mash_street_no" var="mash_street_no"/>
<output path="TNBK_KTOVET_BAIT"/>
<param name="message" value="fn:string((fn:substring($mash_street_no, 1, 6),"")[1])"/>
</customFunction> |
For some reason, I don't get this error while evaluating this expression:
Code: |
<customFunction lang="esql" ref="BidiUtils:esbBidiHebrewConvert">
<input path="request_by_array/request_by/mash_street" var="mash_street"/>
<output path="TNBK_KTOVET_REHOV"/>
<param name="message" value="fn:string(($mash_street,"")[1])"/>
</customFunction>
|
|
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Feb 13, 2018 5:27 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Looks like you have a type mismatch for the output...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
alaychem |
Posted: Thu Feb 15, 2018 2:10 am Post subject: |
|
|
Acolyte
Joined: 10 Feb 2016 Posts: 66
|
For the output?? no... "BidiUtils:esbBidiHebrewConvert" returns a string, nothing else. |
|
Back to top |
|
 |
martinb |
Posted: Mon Feb 19, 2018 2:37 am Post subject: |
|
|
Master
Joined: 09 Nov 2006 Posts: 210 Location: UK
|
Hi
My guess is that the XPath error XPTY0004 is being thrown because you are causing one of the XPath functions that requires a single value argument to be invoked with a sequence of values.
I note you are using the array operator, "[1]" to coalesce possible sequence into a single value. However it looks like your placement is such that it will only protect the fn:string() cast function but not the fn:substring(). Also I suspect you'd want the string cast applied first.
I think you'd need something more like this:-
Code: |
<param name="message" value="fn:substring((fn:string($mash_street_no),"")[1], 1, 6)"/>
|
HTH |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|