I am using IBM App Connect 11 .I need to pass xpath as a string to an esql method.The Xpath corresponds to a specific element "text", so I need to pass the condition where keyIdentifier='TIN' as well.I tried like this :
SET xpathStr = '/getDocumentList/searchType/KeySet[keyIdentifier=TIN]/text';
I am not able to give [keyIdentifier='TIN'] as the whole statement itself a string, so syntax error will come.
Input xml :
<getDocumentList>
<searchType>
<KeySet>
<keyIdentifier>SIN</keyIdentifier>
<text>abc</text>
</KeySet>
<KeySet>
<keyIdentifier>TIN</keyIdentifier>
<text>xyz</text>
</KeySet>
</searchType>
</getDocumentList>
You can do this with
SELECT, see also Returning a scalar value in a message: