on 01-14-2010 1:38 PM
Hi everybody,
how can I combine substring with contains?
The following does not work
/ns1:MYINTERFACE[contains(substring(/ns1:MYINTERFACE,1,90),'STRINGTOSEARCH')]
Thanks, Regards
Mario
sorry, got no time to test it
Regards
Mario
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mario,
I feel that u have requirement that if a specified character or substring exist in your field then you have to determine the Receiver.
In stead of contains same functionality u can achieve by writng whole XPATH expression in one line and use the EX operator for this purpose
/ns1:MYINTERFACE[contains(substring(/ns1:MYINTERFACE,1,90)] and then use the EX operator
You can go through this link which will give u detail insight
/people/shabarish.vijayakumar/blog/2006/06/07/customise-your-xpath-expressions-in-receiver-determination
Regards,
Saurabh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Murali,
As per my undrstanding you have a segment MYINTERFACE . In which there is a field name say X
Now you want to check that the first 90 character of the value of X does not contains a particular Straing say 'STRINGTOSEARCH' then you have to determine the receiver .
If my understanding is right
then you can use this in XPATH
/ns1:MYINTERFACE[ not(contains(substring(X,1,90),'STRINGTOSEARCH'))]
come out of XPATH
and then use the EX operator you can also check for = operator and put value false in right operand of conditon editor
Regards,
Saurabh
Hi Saurabh,
your are almost rigth.
But the Interface has no child nodes:
<?xml version="1.0" encoding="utf-8"?>
<ns1:VV2_SIMPLE xmlns:ns1="http://sap.com/xi/ISU-IDEX-GE/VV2">UNA:.? 'UNBUNOC:39900ssss005:500990sssssss07:500091221:1336000002204809+VL'UNH000002204809MSCONS:D:04B:UN:2.1a'BGM7::50000022048099'DTM137:200912211336:203'NAD</ns1:VV2_SIMPLE>
But your XPATH gives a String back, not a boolean. So it is not working with EX
Regards Mario
Why not include the STRINGTOSEARCH as the right operand in the condition editor and the middle operand will be equalto sign.
I think I got your question wrong
/ns1:MYINTERFACE[contains(substring(/ns1:MYINTERFACE,1,90),'STRINGTOSEARCH')]
The above should not work because you have used MYINTERFACE at both the places.....the first occurence is fine (MYINTERFACE seems to be the root node of source message) but the second occurence should be the name of the node on which you want to apply the substring.....can you paste the source structure?
Regards,
Abhishek.
Edited by: abhishek salvi on Jan 14, 2010 7:34 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.